How to delay certbot challenges (service discovery too slow)?

We are trying to run certbot in Docker Swarm with service discovery. The issue we have is that certbot immediately starts the challenge with a new URL, before the reverse proxy has picked up the container through service discovery. When the reverse proxy has registered certbot and the routing for /.well-known/acme-challenge is set up, certbot has already died. Then Docker Swarm starts certbot again - and the circle starts again.

In the docs seems to be no option to let certbot wait for like 15 seconds after startup. Is there a workaround?

You can use the --pre-hook to set up routing (and --post-hook to tear it down) before the core Certbot logic runs.

4 Likes

Thanks, that works: --pre-hook "/bin/sleep 15"

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.