Certbot Setup
This folder is used as the webroot for HTTP-01 challenges. To issue/renew certificates with Let's Encrypt (or any ACME CA), run:
# Replace your.domain and email with real values
docker compose run --rm --profile certbot certbot certonly \
--webroot -w /var/www/certbot \
-d your.domain \
--email you@example.com \
--agree-tos --no-eff-emailVolumes:
./certsmounts to/etc/letsencrypt(certs/keys will be stored here and used by OpenResty)../certbot/wwwmounts to/var/www/certbot(ACME challenge webroot).
Automation:
Provide
CERTBOT_DOMAINS(comma-separated) andCERTBOT_EMAILin your.env.Run
docker compose up -d --profile certbot certbot-init certbot-renewonce.certbot-initwill issue if missing;certbot-renewwill renew every 12h and OpenResty will auto-reload when cert files change.If you skip
CERTBOT_DOMAINS/CERTBOT_EMAIL, the stack falls back to self-signed localhost certs that rotate automatically every ~87 days inside the OpenResty container (good for local/dev only).
If you prefer manual control, skip the services above and run certbot commands as needed, then docker compose restart openresty.
Last updated