self-hosted/traefik/docker-compose.yml

37 lines
946 B
YAML
Raw Normal View History

2021-12-13 20:29:29 +01:00
services:
traefik:
2024-04-16 05:14:04 +02:00
image: traefik:v2.11.2
2021-12-13 20:29:29 +01:00
container_name: traefik
2023-10-04 07:19:03 +02:00
init: true
2021-12-13 20:29:29 +01:00
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
ports:
- 80:80
- 443:443
2023-10-04 07:19:03 +02:00
environment:
- TZ=Europe/Madrid
2021-12-13 20:29:29 +01:00
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
2024-04-16 05:14:04 +02:00
- ./traefik.yml:/traefik.yml:ro
- ./dynamic.yml:/dynamic.yml:ro
- ./users.txt:/users.txt:ro
- ./acme.json:/acme.json
2023-10-04 07:19:03 +02:00
- logs:/var/log/traefik
2021-12-13 20:29:29 +01:00
labels:
- traefik.enable=true
2023-10-04 07:19:03 +02:00
- traefik.http.services.traefik.loadbalancer.server.port=80
2021-12-13 20:29:29 +01:00
- traefik.http.routers.traefik-secure.entrypoints=websecure
2023-10-04 07:19:03 +02:00
- traefik.http.routers.traefik-secure.rule=Host(`${FQDN}`)
- traefik.http.routers.traefik-secure.middlewares=myauth@file
2021-12-13 20:29:29 +01:00
- traefik.http.routers.traefik-secure.service=api@internal
2023-10-04 07:19:03 +02:00
volumes:
logs: {}
2021-12-13 20:29:29 +01:00
networks:
proxy:
external: true