60 lines
1.3 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:
caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine
container_name: caddy
restart: unless-stopped
labels:
caddy.email: ${CADDY_EMAIL}
environment:
# $ docker network create caddy
CADDY_INGRESS_NETWORKS: caddy
CADDY_DOCKER_CADDYFILE_PATH: "/etc/caddy/Caddyfile"
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- caddy_data:/data
- ./Caddyfile:/etc/caddy/Caddyfile
networks:
- caddy
ulimits:
nofile: 65535
logging: *default-logging
networks:
caddy:
external: true
volumes:
caddy_data: {}
# What if I want to use the x-opt-values:
# caddy_data:
# <<: *volume-opt
# driver_opts:
# <<: *options
# device: ":/mnt/path/caddy-proxy/caddy_data"
# o: "new_opts"
# type: "new_type"
#
# 'o' and 'type' can be redifined again or left at default