Hi,
I’m running Caddy 0.11 in a Docker container on an Amazon EC2 instance. Everything was working great until I made a few tweaks to my site, pushing and pulling the Docker image and restarting the container several times within a few minutes. At which point I hit the rate limit error below from Let’s Encrypt:
registration error: acme: error: 429 :: POST :: https://acme-v02.api.letsencrypt.org/acme/new-acct :: urn:ietf:params:acme:error:rateLimited :: Error creating new account :: too many registrations for this IP: see Rate Limits - Let's Encrypt
I’m running the Docker container with the Let’s Encrypt files mounted in a volume using this command: docker run -d -p 80:80 -p 443:443 -v /home/ec2-user/dotcaddy:/.caddy:rw --name caddy --ulimit nofile=8192:8192 --restart always myrepo/mywebsite.com
This is what my Dockerfile looks like:
FROM scratch
COPY rootfs /
COPY Caddyfile /var/www/html/
COPY public/ /var/www/html/public/
EXPOSE 443 2015
WORKDIR /var/www/html
ENTRYPOINT ["/bin/caddy", "-agree”]
rootfs just contains the Caddy executable in /bin and the SSL root certificates in /etc/ssl/certs/ca-certificates.crt
This is my Caddyfile:
www.mywebsite.com {
redir https://mywebsite.com{uri}
}
mywebsite.com {
errors {
404 404.html
}
expires {
match .css$ 7d
match .js$ 7d
match .png$ 7d
match .svg$ 7d
}
ext .html .htm
gzip
root /var/www/html/public
tls myemail@mywebsite.com
header / {
-Server
Strict-Transport-Security "max-age=31536000;"
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
}
}
I don’t understand why Caddy is trying to register my site with Let’s Encrypt every time I restart the Docker container. How can I avoid this error in future?
Thanks,
John