nginx-reverse-proxy/docker-compose.yml
2024-08-28 16:18:07 +03:00

28 lines
826 B
YAML

version: '3'
services:
nginx:
image: nginx:latest
container_name: nginx-reverse-proxy
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./certs:/etc/letsencrypt
- ./html:/var/www/html
- ./logs/nginx:/var/log/nginx
restart: always
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- ./certs:/etc/letsencrypt
- ./html:/var/www/html
# command: certonly --webroot --webroot-path=/var/www/html --email your.email@example --agree-tos --no-eff-email -d your.domain.example
command: renew --webroot --webroot-path=/var/www/html
entrypoint: /bin/sh -c "trap exit TERM; while :; do certbot renew --webroot --webroot-path=/var/www/html; sleep 12h & wait $${!}; done;"
depends_on:
- nginx