self-hosted/traefik/docker-compose.yml

37 lines
946 B
YAML

services:
traefik:
image: traefik:v2.11.2
container_name: traefik
init: true
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
ports:
- 80:80
- 443:443
environment:
- TZ=Europe/Madrid
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/traefik.yml:ro
- ./dynamic.yml:/dynamic.yml:ro
- ./users.txt:/users.txt:ro
- ./acme.json:/acme.json
- logs:/var/log/traefik
labels:
- traefik.enable=true
- traefik.http.services.traefik.loadbalancer.server.port=80
- traefik.http.routers.traefik-secure.entrypoints=websecure
- traefik.http.routers.traefik-secure.rule=Host(`${FQDN}`)
- traefik.http.routers.traefik-secure.middlewares=myauth@file
- traefik.http.routers.traefik-secure.service=api@internal
volumes:
logs: {}
networks:
proxy:
external: true