-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.certbot.yml
More file actions
35 lines (32 loc) · 968 Bytes
/
docker-compose.prod.certbot.yml
File metadata and controls
35 lines (32 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
version: '3.8'
services:
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- ./web-app/.well-known/acme-challenge:/var/www/html/.well-known/acme-challenge # ACME challenge folder
- ./web-app/ssl:/etc/letsencrypt # Mount SSL keys
environment:
- CERTBOT_MODE=${CERTBOT_MODE:-generate} # Mode: 'generate' or 'renew'
entrypoint: >
sh -c "
if [ \"$CERTBOT_MODE\" = \"generate\" ]; then
certbot certonly \
--non-interactive \
--webroot \
--webroot-path /var/www/html \
--email ${DOMAIN_EMAIL} \
--agree-tos \
-d ${DOMAIN},www.${DOMAIN} \
--debug --verbose;
elif [ \"$CERTBOT_MODE\" = \"renew\" ]; then
certbot renew --quiet;
else
echo 'Invalid CERTBOT_MODE specified. Use generate or renew.';
exit 1;
fi"
networks:
- app-network
networks:
app-network:
driver: bridge