First commit
This commit is contained in:
82
docker-compose.yaml
Normal file
82
docker-compose.yaml
Normal file
@@ -0,0 +1,82 @@
|
||||
# https://doc.traefik.io/traefik/setup/docker/
|
||||
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:v3.6.7
|
||||
container_name: traefik
|
||||
restart: unless-stopped
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
|
||||
networks:
|
||||
# Connect to the 'traefik_proxy' overlay network for inter-container communication across nodes
|
||||
- proxy
|
||||
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- "8080:8080"
|
||||
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- ./certs:/certs:ro
|
||||
- ./dynamic:/dynamic:ro
|
||||
- ./traefik.yml:/etc/traefik/traefik.yml:ro
|
||||
|
||||
command:
|
||||
# EntryPoints
|
||||
- "--entrypoints.web.address=:80"
|
||||
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
|
||||
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
|
||||
- "--entrypoints.web.http.redirections.entrypoint.permanent=true"
|
||||
- "--entrypoints.websecure.address=:443"
|
||||
- "--entrypoints.websecure.http.tls=true"
|
||||
|
||||
# Attach the static configuration tls.yaml file that contains the tls configuration settings
|
||||
- "--providers.file.filename=/dynamic/tls.yaml"
|
||||
|
||||
# Providers
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
- "--providers.docker.network=proxy"
|
||||
|
||||
# API & Dashboard
|
||||
- "--api.dashboard=true"
|
||||
- "--api.insecure=false"
|
||||
|
||||
# Observability
|
||||
- "--log.level=INFO"
|
||||
- "--accesslog=true"
|
||||
- "--metrics.prometheus=true"
|
||||
|
||||
# Traefik Dynamic configuration via Docker labels
|
||||
labels:
|
||||
# Enable self‑routing
|
||||
- "traefik.enable=true"
|
||||
|
||||
# Dashboard router
|
||||
- "traefik.http.routers.dashboard.rule=Host(`dashboard.docker.localhost`)"
|
||||
- "traefik.http.routers.dashboard.entrypoints=websecure"
|
||||
- "traefik.http.routers.dashboard.service=api@internal"
|
||||
- "traefik.http.routers.dashboard.tls=true"
|
||||
|
||||
# Basic‑auth middleware
|
||||
- "traefik.http.middlewares.dashboard-auth.basicauth.users=${PASS_HASH}"
|
||||
- "traefik.http.routers.dashboard.middlewares=dashboard-auth@docker"
|
||||
|
||||
# Whoami application
|
||||
whoami:
|
||||
image: traefik/whoami
|
||||
container_name: whoami
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- proxy
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
|
||||
- "traefik.http.routers.whoami.entrypoints=websecure"
|
||||
- "traefik.http.routers.whoami.tls=true"
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
name: proxy
|
||||
Reference in New Issue
Block a user