2022-02-06 19:01:07 +01:00
|
|
|
version: '2.1'
|
|
|
|
services:
|
|
|
|
nginx:
|
|
|
|
image: nginx
|
2023-08-18 13:41:07 +02:00
|
|
|
container_name: proxy_nginx
|
2022-02-13 19:36:17 +01:00
|
|
|
restart: unless-stopped
|
2022-02-06 19:01:07 +01:00
|
|
|
ports:
|
|
|
|
- "80:80"
|
|
|
|
- "443:443"
|
|
|
|
volumes:
|
|
|
|
- nginx_conf:/etc/nginx/conf.d
|
|
|
|
- certs:/etc/nginx/certs
|
|
|
|
- vhost:/etc/nginx/vhost.d
|
|
|
|
- html:/usr/share/nginx/html
|
2023-12-21 10:53:52 +01:00
|
|
|
- htpasswd:/etc/nginx/htpasswd
|
2022-02-06 19:01:07 +01:00
|
|
|
networks:
|
|
|
|
- webproxy
|
|
|
|
|
|
|
|
dockergen:
|
|
|
|
image: nginxproxy/docker-gen
|
|
|
|
container_name: dockergen
|
|
|
|
command: -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl
|
|
|
|
/etc/nginx/conf.d/default.conf
|
2022-02-13 19:36:17 +01:00
|
|
|
restart: unless-stopped
|
2023-08-18 11:38:53 +02:00
|
|
|
environment:
|
|
|
|
- ENABLE_IPV6=true
|
2022-02-06 19:01:07 +01:00
|
|
|
volumes_from:
|
|
|
|
- nginx
|
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
|
|
|
# - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl # use this for the file next to this file
|
2022-02-06 19:12:39 +01:00
|
|
|
- nginx_tmpl:/etc/docker-gen/templates/ # use this for a named volume containing the file
|
2022-02-06 19:01:07 +01:00
|
|
|
networks:
|
|
|
|
- webproxy
|
|
|
|
|
|
|
|
acme-companion:
|
|
|
|
image: nginxproxy/acme-companion
|
2022-02-13 19:36:17 +01:00
|
|
|
restart: unless-stopped
|
2022-02-06 19:01:07 +01:00
|
|
|
volumes_from:
|
|
|
|
- nginx
|
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
|
|
- acme:/etc/acme.sh
|
|
|
|
environment:
|
|
|
|
- NGINX_DOCKER_GEN_CONTAINER=dockergen
|
|
|
|
# - ACME_CA_URI=https://acme-staging-v02.api.letsencrypt.org/directory # set this for staging environment from letsencrypt
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
nginx_conf:
|
2022-02-06 19:12:39 +01:00
|
|
|
nginx_tmpl:
|
2022-02-06 19:01:07 +01:00
|
|
|
certs:
|
|
|
|
vhost:
|
|
|
|
html:
|
|
|
|
acme:
|
2023-12-21 10:53:52 +01:00
|
|
|
htpasswd:
|
2022-02-06 19:01:07 +01:00
|
|
|
|
|
|
|
networks:
|
|
|
|
webproxy:
|
|
|
|
name: webproxy
|