Docker compose static config issue

Getting an error

Seems like the paste keeps the formatting: Ubuntu Pastebin

command traefik error: failed to decode configuration from environment variables: field not found, node: domain

docker-compose.yml

reverse-proxy:
        image: traefik:2.4
        restart: unless-stopped
        logging:
            driver: journald
        environment:
            - TZ=${MAIN_TZ}
            - CF_API_TOKEN=/run/secrets/cf_api_token
            - CF_API_EMAIL=/run/secrets/cf_api_email
            # Traefik Base config -- https://doc.traefik.io/traefik/reference/static-configuration/env/
            - TRAEFIK_API_DASHBOARD=true
            - TRAEFIK_GLOBAL_CHECKNEWVERSION=true
            - TRAEFIK_GLOBAL_SENDANONYMOUSUSAGE=false
            # Logging
            - TRAEFIK_LOG_LEVEL=ERROR
            - TRAEFIK_LOG_FILEPATH= #Aka docker-journald
            - TRAEFIK_ACCESSLOG=true
            - TRAEFIK_ACCESSLOG_BUFFERINGSIZE=50
            - TRAEFIK_ACCESSLOG_FILTERS_RETRYATTEMPTS=true
            # Web - :80
            - TRAEFIK_ENTRYPOINTS_web=true
            - TRAEFIK_ENTRYPOINTS_web_ADDRESS=":80"
            - TRAEFIK_ENTRYPOINTS_web_HTTP_REDIRECTIONS_ENTRYPOINT_SCHEME=https
            - TRAEFIK_ENTRYPOINTS_web_HTTP_REDIRECTIONS_ENTRYPOINT_TO=websecure
            # Websecure :443
            - TRAEFIK_ENTRYPOINTS_websecure=true
            - TRAEFIK_ENTRYPOINTS_websecure_ADDRESS=":443"
            - TRAEFIK_ENTRYPOINTS_websecure_HTTP_TLS=true
            - TRAEFIK_ENTRYPOINTS_websecure_HTTP_TLS_CERTRESOLVER=zerossl
            # Traefik Entrypoints
            - TRAEFIK_ENTRYPOINTS_MAIN_DOMAIN_HTTP_TLS_DOMAINS=${MAIN_DOMAIN_URL}
            - TRAEFIK_ENTRYPOINTS_MAIN_DOMAIN_HTTP_TLS_DOMAINS_n_MAIN=${MAIN_DOMAIN_URL}
            - TRAEFIK_ENTRYPOINTS_MAIN_DOMAIN_HTTP_TLS_DOMAINS_n_SANS=*.${MAIN_DOMAIN_URL}
            # HTTP CERT RESOLVER
            - TRAEFIK_CERTIFICATESRESOLVERS_http=true
            - TRAEFIK_CERTIFICATESRESOLVERS_http_ACME_EMAIL=/run/secrets/admin_email
            - TRAEFIK_CERTIFICATESRESOLVERS_http_ACME_STORAGE=acme.json
            - TRAEFIK_CERTIFICATESRESOLVERS_http_ACME_HTTPCHALLENGE=true
            - TRAEFIK_CERTIFICATESRESOLVERS_http_ACME_HTTPCHALLENGE_ENTRYPOINT=http
            # DNS/Cloudflare CERT RESOLVER
            - TRAEFIK_CERTIFICATESRESOLVERS_dns=true
            - TRAEFIK_CERTIFICATESRESOLVERS_dns_ACME_EMAIL=/run/secrets/admin_email
            - TRAEFIK_CERTIFICATESRESOLVERS_dns_ACME_STORAGE=acme.json
            - TRAEFIK_CERTIFICATESRESOLVERS_dns_ACME_DNSCHALLENGE=true
            - TRAEFIK_CERTIFICATESRESOLVERS_dns_ACME_DNSCHALLENGE_PROVIDER=cloudflare
            - TRAEFIK_CERTIFICATESRESOLVERS_dns_ACME_DNSCHALLENGE_RESOLVERS=1.1.1.1:53,1.0.0.1:53
            # DNS/ZeroSSL CERT RESOLVER
            - TRAEFIK_CERTIFICATESRESOLVERS_zerossl=true
            - TRAEFIK_CERTIFICATESRESOLVERS_zerossl_ACME_EMAIL=/run/secrets/admin_email
            - TRAEFIK_CERTIFICATESRESOLVERS_zerossl_ACME_STORAGE=acme.json
            - TRAEFIK_CERTIFICATESRESOLVERS_zerossl_ACME_CASERVER=https://acme.zerossl.com/v2/DV90
            - TRAEFIK_CERTIFICATESRESOLVERS_zerossl_ACME_DNSCHALLENGE=true
            - TRAEFIK_CERTIFICATESRESOLVERS_zerossl_ACME_DNSCHALLENGE_PROVIDER=cloudflare
            - TRAEFIK_CERTIFICATESRESOLVERS_zerossl_ACME_DNSCHALLENGE_RESOLVERS=1.1.1.1:53,1.0.0.1:53
            - TRAEFIK_CERTIFICATESRESOLVERS_zerossl_ACME_EAB_KID=/run/secrets/zero_eab_kid
            - TRAEFIK_CERTIFICATESRESOLVERS_zerossl_ACME_EAB_HMACENCODED=/run/secrets/zero_eab_hmac
            # Docker
            - TRAEFIK_PROVIDERS_DOCKER=true
            - TRAEFIK_PROVIDERS_DOCKER_EXPOSEDBYDEFAULT=false
            - TRAEFIK_PROVIDERS_DOCKER_WATCH=true
            # File
            - TRAEFIK_PROVIDERS_FILE_WATCH=true
            - TRAEFIK_PROVIDERS_FILE_DIRECTORY=/rules
        ports:
            - '80:80'
            - '8080:8080'
            - '443:443'
            - '127.0.0.2:53:53/tcp'
            - '127.0.0.2:53:53/udp'
            - '127.0.0.2:853:853'
        security_opt:
            - no-new-privileges:true
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - /etc/localtime:/etc/localtime:ro
            # - ${PWD}/config/traefik/traefik.yml:/traefik.yml:ro
            - ${PWD}/config/traefik/keys:/keys
            - ${PWD}/config/traefik/keys/acme.json:/keys/acme.json
            - ${PWD}/config/traefik/plugins-storage:/plugins-storage:rw
            - ${PWD}/config/traefik/rules:/rules:ro
        labels:
            - 'traefik.enable=true'
            - 'traefik.http.routers.traefik-https.entrypoints=websecure'
            - 'traefik.http.routers.traefik-https.rule=Host(`traefik.${MAIN_DOMAIN_URL}`)'
            - 'traefik.http.routers.traefik-https.middlewares=authelia@docker'
            - 'traefik.http.routers.traefik-https.service=api@internal'
            - 'traefik.http.routers.traefik-https.tls=true'
            - 'traefik.http.routers.traefik-https.tls.certresolver=zerossl'
            # Authelia
            - 'traefik.http.middlewares.authelia.forwardauth.address=http://authelia:9091/api/verify?rd=https://auth.EXAMPLE.com/'
            - 'traefik.http.middlewares.authelia.forwardauth.trustforwardheader=true'
            - 'traefik.http.middlewares.authelia.forwardauth.authresponseheaders=Remote-User,Remote-Groups'
        read_only: true
        # depends_on:
        #   - auth-portal
        networks:
            - EXAMPLEcom

Is there a list of required configuration options? Or is there a way to see what line in the config is causing the error?

Hello,

you have to rename MAIN_DOMAIN to MAINDOMAIN, _ is not allowed in the names when use env vars.

I recommend using CLI flags instead of env vars.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.