Files
nginx/docker-compose.yml

32 lines
909 B
YAML

services:
web:
container_name: nginx
image: nginx:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./data/nginx.conf:/etc/nginx/nginx.conf:ro
- ./data/conf.d:/etc/nginx/conf.d:ro
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
restart: always
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
networks:
- nginx
certbot:
image: certbot/dns-cloudflare:latest
restart: unless-stopped
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
- /var/run/docker.sock:/var/run/docker.sock # Allows container to talk to Docker
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
networks:
- nginx
networks:
nginx:
driver: bridge
external: true