# named network 'entertainment' is marked as "external" (used by service 'traefik'), so either remove "external" from network definition or it needs to be created using: docker network create -d bridge entertainment
name: <your project name>
services:
    traefik:
        container_name: traefik
        hostname: traefik
        networks:
            - entertainment
        ports:
            - 80:80
            - 443:443
            - 8080:8080
        environment:
            - DUCKDNS_TOKEN=d5c7269c-cb17-4615-b10a-0bfee32dfef7
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - /mnt/docker/data/traefik/letsencrypt:/letsencrypt
        labels:
            - traefik.enable=true
            - traefik.docker.network=entertainment
        image: traefik:3.4
        command: 
            --log=true 
            --log.level=DEBUG 
            --global.sendAnonymousUsage=false
            --global.checkNewVersion=false 
            --providers.docker=true
            --providers.docker.exposedbydefault=true
            --providers.docker.defaultrule='Host(`{{ normalize .Name}}.DUCKDNS_DOMAIN`)'
            --entrypoints.http=true
            --entrypoints.http.address='0.0.0.0:80'
            --entrypoints.http.http.redirections.entrypoint.to='https'
            --entrypoints.http.http.redirections.entrypoint.scheme='https'
            --entrypoints.https=true
            --entrypoints.https.address='0.0.0.0:443'
            --entrypoints.https.http.tls.domains[0].main='DUCKDNS_DOMAIN'
            --entrypoints.https.http.tls.domains[0].sans='*.DUCKDNS_DOMAIN'
            --entrypoints.https.http.tls.certresolver='duckdns'
            --entrypoints.https.http.tls=true
            --entrypoints.https.http.middlewares='authelia@docker'
            --certificatesresolvers.duckdns.acme.storage='/letsencrypt/acme.json'
            --certificatesresolvers.duckdns.acme.dnschallenge=true
            --certificatesresolvers.duckdns.acme.dnschallenge.provider='duckdns'
            --certificatesresolvers.duckdns.acme.email='DUCKDNS_EMAIL'
            --certificatesresolvers.duckdns.acme.dnschallenge.resolvers='8.8.8.8,8.8.4.4'
networks:
    entertainment:
        external: true
        name: entertainment
