miniNAS/docker_compose/nginx.yml

52 lines
1.3 KiB
YAML
Executable File

version: "2"
services:
nginx:
restart: always
image: nginxproxy/nginx-proxy:latest
container_name: nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
- "/etc/nginx/conf.d"
- "/etc/nginx/vhost.d"
- "/usr/share/nginx/html"
- "/var/run/docker.sock:/tmp/docker.sock:ro"
- "$CERTS_DIR:/etc/nginx/certs:ro"
nginx-gen:
restart: always
image: nginxproxy/docker-gen
container_name: nginx-gen
volumes:
- "/var/run/docker.sock:/tmp/docker.sock:ro"
- "$NGINX_TMPL:/etc/docker-gen/templates/nginx.tmpl:ro"
networks:
- default
volumes_from:
- nginx
entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
acme-companion:
restart: always
image: nginxproxy/acme-companion:latest
container_name: acme-companion
volumes_from:
- nginx
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "$CERTS_DIR:/etc/nginx/certs:rw"
- "$ACME_SH_DIR:/etc/acme.sh"
environment:
- NGINX_DOCKER_GEN_CONTAINER=nginx-gen
depends_on:
- nginx
networks:
- default
networks:
default:
external:
name: $SERVER_DOCKER_NETWORKNAME