100 lines
3.4 KiB
YAML
100 lines
3.4 KiB
YAML
services:
|
|
socket-proxy:
|
|
image: tecnativa/docker-socket-proxy
|
|
container_name: socket-proxy
|
|
restart: always
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro # Only place the real socket is mounted
|
|
environment:
|
|
- CONTAINERS=1 # Traefik needs to see containers
|
|
- NETWORKS=1 # Traefik needs to see networks
|
|
- SERVICES=1
|
|
- TASKS=1
|
|
- IMAGES=1 # Needed for Watchtower/Portainer
|
|
- VOLUMES=1 # Needed for Portainer
|
|
- POST=1 # Needed for Portainer/Watchtower to start/stop/create containers
|
|
- DELETE=1 # Needed for Portainer/Watchtower to remove containers/images
|
|
- DOCKER_API_VERSION=1.40
|
|
- VERSION=1 # Allow Traefik to query version
|
|
- INFO=1 # Allow Traefik to query info
|
|
- EVENTS=1 # Allow Traefik to monitor container changes
|
|
- PING=1 # Allow Traefik to check Docker health
|
|
- BUILD=0
|
|
- COMMIT=0
|
|
- CONFIGS=0
|
|
- DISTRIBUTION=0
|
|
- EXEC=0
|
|
- NODES=0
|
|
- PLUGINS=0
|
|
- SECRETS=0
|
|
- SWARM=0
|
|
- SYSTEM=0
|
|
networks:
|
|
- socket-net
|
|
|
|
traefik:
|
|
image: traefik:v3.6
|
|
container_name: traefik
|
|
restart: always
|
|
depends_on:
|
|
- socket-proxy
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
environment:
|
|
- DYNU_API_KEY=${DYNU_API_KEY}
|
|
- DOCKER_API_VERSION=1.40
|
|
command:
|
|
- "--api.dashboard=true"
|
|
- "--providers.docker=true"
|
|
- "--providers.docker.endpoint=tcp://socket-proxy:2375"
|
|
- "--providers.docker.exposedByDefault=false"
|
|
- "--entrypoints.web.address=:80"
|
|
- "--entrypoints.websecure.address=:443"
|
|
# SSL Setup
|
|
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
|
|
- "--certificatesresolvers.myresolver.acme.dnschallenge.provider=dynu"
|
|
- "--certificatesresolvers.myresolver.acme.email=${ACME_EMAIL}"
|
|
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
|
|
volumes:
|
|
- ./letsencrypt:/letsencrypt
|
|
networks:
|
|
- socket-net
|
|
- proxy-net
|
|
labels:
|
|
- "traefik.enable=true"
|
|
|
|
# Middleware: Redirect to HTTPS
|
|
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
|
|
- "traefik.http.middlewares.https-redirect.redirectscheme.permanent=true"
|
|
|
|
# Dashboard - Public (HTTPS)
|
|
- "traefik.http.routers.traefik-dash.rule=Host(`traefik.arch-services.mywire.org`)"
|
|
- "traefik.http.routers.traefik-dash.entrypoints=websecure"
|
|
- "traefik.http.routers.traefik-dash.tls.certresolver=myresolver"
|
|
- "traefik.http.routers.traefik-dash.service=api@internal"
|
|
- "traefik.http.routers.traefik-dash.middlewares=authelia-auth@docker"
|
|
|
|
# Dashboard - Public (Redirect)
|
|
- "traefik.http.routers.traefik-dash-red.rule=Host(`traefik.arch-services.mywire.org`)"
|
|
- "traefik.http.routers.traefik-dash-red.entrypoints=web"
|
|
- "traefik.http.routers.traefik-dash-red.middlewares=https-redirect@docker"
|
|
|
|
# Dashboard - Local (HTTP)
|
|
- "traefik.http.routers.traefik-dash-local.rule=Host(`traefik.localhost`)"
|
|
- "traefik.http.routers.traefik-dash-local.entrypoints=web"
|
|
- "traefik.http.routers.traefik-dash-local.service=api@internal"
|
|
|
|
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
networks:
|
|
socket-net:
|
|
external: true
|
|
proxy-net:
|
|
external: true
|