Homelab/traefik.yaml

42 lines
1.2 KiB
YAML

traefik:
configs:
- source: traefik-config
target: /etc/traefik/traefik.toml
deploy:
labels:
traefik.enable: "true"
traefik.http.routers.traefik-rtr.entrypoints: "websecure"
traefik.http.routers.traefik-rtr.middlewares: "traefik-allowlist@file"
traefik.http.routers.traefik-rtr.rule: "Host(`traefik.your.domain`)"
traefik.http.routers.traefik-rtr.service: "api@internal"
traefik.http.services.dummy-svc.loadbalancer.server.port: "9999"
replicas: 1
healthcheck:
test: ["CMD","traefik","healthcheck"]
interval: 30s
timeout: 10s
image: "traefik:3.0"
logging:
driver: journald
networks:
- homelab
ports:
- published: 80
target: 10080
protocol: "tcp"
mode: "host"
- published: 443
target: 10443
protocol: "tcp"
mode: "host"
- published: 10022
target: 10022
protocol: "tcp"
mode: "host"
restart: on-failure
volumes:
- "/srv/data/docker/traefik/rules:/rules:ro"
- "/srv/data/docker/traefik/acme:/acme:rw"
- "/srv/data/docker/traefik/logs:/logs:rw"
- "/run/docker.sock:/run/docker.sock:ro"