Currently trying to generalize a bit more the compose files. No need to keep the NFS mounts explicitly stated, as most of the times just a small Docker native volume is needed for persistence.
79 lines
1.8 KiB
YAML
79 lines
1.8 KiB
YAML
x-logging:
|
|
&default-logging
|
|
driver: syslog
|
|
options:
|
|
# This requires two files in /etc/rsyslog.d
|
|
# https://www.loggly.com/use-cases/docker-syslog-logging-and-troubleshooting/
|
|
tag: "container_name/{{.Name}}"
|
|
labels: "${hostname}"
|
|
syslog-facility: # cron, local7, etc.
|
|
|
|
# Can be removed if not needed
|
|
x-opt-values:
|
|
&volume-opt
|
|
driver_opts: &options
|
|
type: "nfs"
|
|
o: "addr=${IP},rw"
|
|
|
|
services:
|
|
nginx-proxy:
|
|
image: jwilder/nginx-proxy
|
|
container_name: proxy
|
|
labels:
|
|
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
restart: always
|
|
volumes:
|
|
- conf:/etc/nginx/conf.d
|
|
- vhost:/etc/nginx/vhost.d
|
|
- passwords:/etc/nginx/htpasswd
|
|
- html:/usr/share/nginx/html
|
|
- certs:/etc/nginx/certs:ro
|
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
|
networks:
|
|
- reverse-proxy
|
|
logging: *default-logging
|
|
|
|
letsencrypt:
|
|
image: nginxproxy/acme-companion
|
|
container_name: letsencrypt
|
|
restart: always
|
|
volumes:
|
|
- conf:/etc/nginx/conf.d
|
|
- vhost:/etc/nginx/vhost.d
|
|
- html:/usr/share/nginx/html
|
|
- certs:/etc/nginx/certs:rw
|
|
- acme:/etc/acme.sh
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
environment:
|
|
NGINX_PROXY_CONTAINER: proxy
|
|
DEFAULT_EMAIL: ${DEFAULT_EMAIL}
|
|
networks:
|
|
- reverse-proxy
|
|
logging: *default-logging
|
|
|
|
networks:
|
|
reverse-proxy:
|
|
|
|
volumes:
|
|
acme:
|
|
certs:
|
|
conf:
|
|
html:
|
|
passwords:
|
|
vhost:
|
|
|
|
# What if I want to use the x-opt-values:
|
|
# acme:
|
|
# <<: *volume-opt
|
|
# driver_opts:
|
|
# <<: *options
|
|
# device: ":/mnt/path/nginx-proxy/acme"
|
|
# o: "new_opts"
|
|
# type: "new_type"
|
|
#
|
|
# 'o' and 'type' can be redifined again or left at default
|
|
|