extra certbot container removed
This commit is contained in:
11
certbot/entrypoint.sh
Normal file
11
certbot/entrypoint.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
if [ ! -d /etc/letsencrypt/live/${DOMAIN} ]; then
|
||||||
|
certbot certonly --webroot -w /var/www/certbot --email ${EMAIL} -d ${DOMAIN} -d www.${DOMAIN} --agree-tos --non-interactive;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
trap exit TERM;
|
||||||
|
|
||||||
|
while :; do
|
||||||
|
certbot renew --webroot -w /var/www/certbot;
|
||||||
|
sleep 12h & wait $${!};
|
||||||
|
done
|
||||||
@@ -29,19 +29,10 @@ services:
|
|||||||
image: certbot/certbot
|
image: certbot/certbot
|
||||||
container_name: certbot
|
container_name: certbot
|
||||||
volumes:
|
volumes:
|
||||||
|
- ./certbot/entrypoint.sh:/entrypoint.sh
|
||||||
- ./certbot/conf:/etc/letsencrypt
|
- ./certbot/conf:/etc/letsencrypt
|
||||||
- ./certbot/www:/var/www/certbot
|
- ./certbot/www:/var/www/certbot
|
||||||
command: certonly --webroot -w /var/www/certbot --email ${EMAIL} -d ${DOMAIN} -d www.${DOMAIN} --agree-tos --non-interactive
|
entrypoint: ["/entrypoint.sh"]
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
|
|
||||||
certbot-renew:
|
|
||||||
image: certbot/certbot
|
|
||||||
container_name: certbot-renew
|
|
||||||
volumes:
|
|
||||||
- ./certbot/conf:/etc/letsencrypt
|
|
||||||
- ./certbot/www:/var/www/certbot
|
|
||||||
entrypoint: /bin/sh -c "trap exit TERM; while :; do certbot renew --webroot -w /var/www/certbot; sleep 12h & wait $${!}; done;"
|
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user