# traefik - https://doc.traefik.io/traefik/user-guides/docker-compose/basic-example/

services:
    traefik:
        image: "traefik:v3.4"
        container_name: "traefik"
        ports:
            # http port
            - 80:80
            # https port
            - 443:443
            # web ui (insecure)
            - 8080:8080
        environment:
            - CF_DNS_API_TOKEN=${CF_DNS_API_TOKEN}
        volumes:
            # so that traefik can listen to docker events
            - /var/run/docker.sock:/var/run/docker.sock:ro
            - /srv/traefik/config/traefik.yaml:/etc/traefik/traefik.yaml:ro
            - /srv/traefik/data/certs:/var/traefik/certs/:rw
        networks:
            - frontend
        labels:
            - "traefik.http.serversTransports.portainer-insecure-transport.insecureSkipVerify=true"
        restart: unless-stopped

networks:
    frontend:
        external: true
