From f44b81aef0e858d86dec94fc6eba86a95b8a81a8 Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Tue, 16 Jun 2026 14:26:59 +0200 Subject: [PATCH] Added traefik configuration for network --- traefik/docker-compose_network.yaml | 62 +++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 traefik/docker-compose_network.yaml diff --git a/traefik/docker-compose_network.yaml b/traefik/docker-compose_network.yaml new file mode 100644 index 0000000..808e0aa --- /dev/null +++ b/traefik/docker-compose_network.yaml @@ -0,0 +1,62 @@ +services: + traefik: + container_name: traefik + image: traefik:latest +# command: +# - --api +# - --api.dashboard +# - --entrypoints.http.address=:80 +# - --entrypoints.https.address=:443 +# - --providers.docker=true +# - --providers.file.watch=true +# - --log.level=DEBUG + restart: always + #ports: + # - 80:80 + # - 443:443 + environment: + - TZ=${DOCKER_TZ} + secrets: + - ldap_auth_cache_key + volumes: + - ${DOCKER_CFG_DIR}/traefik/traefik.yml:/traefik.yml:ro + - ${DOCKER_CFG_DIR}/traefik/passwd:/passwd + #- ${DOCKER_CFG_DIR}/traefik/acme.json:/acme.json + - ${DOCKER_CFG_DIR}/traefik/config:/config + - ${DOCKER_CFG_DIR}/traefik/traefik.log:/traefik.log + - ${DOCKER_CFG_DIR}/traefik/access.log:/access.log + - /etc/ssl/giorgioravera.it/fullchain.pem:/certs/fullchain.pem + - /etc/ssl/giorgioravera.it/privkey.pem:/certs/privkey.pem + - /var/run/docker.sock:/var/run/docker.sock + network_mode: host + labels: + - "traefik.enable=true" + # Router: HTTP + #- "traefik.http.routers.traefik.entrypoints=http" + #- "traefik.http.routers.traefik.rule=Host(`network.giorgioravera.it`)" + #- "traefik.http.routers.traefik.middlewares=traefik-https-redirect" + # Router: HTTPS + #- "traefik.http.routers.traefik-secure.entrypoints=https" + - "traefik.http.routers.traefik-secure.entrypoints=dashboard" + - "traefik.http.routers.traefik-secure.rule=Host(`network.giorgioravera.it`)" + - "traefik.http.routers.traefik-secure.tls=true" + - "traefik.http.routers.traefik-secure.service=api@internal" + - "traefik.http.routers.traefik-secure.middlewares=traefik-auth-passwd" + #- "traefik.http.routers.traefik-secure.middlewares=traefik-auth-ldap" + # Middleware: Redirect http to https + - "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https" + # Middleware: Passwd Auth + - "traefik.http.middlewares.traefik-auth-passwd.basicauth.usersfile=/passwd/traefik" + # Middlewares: LDAP Auth + #- "traefik.http.middlewares.traefik-auth-ldap.plugin.ldapAuth.enabled=true" + #- "traefik.http.middlewares.traefik-auth-ldap.plugin.ldapAuth.serverList[0].url=ldaps://ldap.giorgioravera.it" + #- "traefik.http.middlewares.traefik-auth-ldap.plugin.ldapAuth.serverList[0].port=636" + #- "traefik.http.middlewares.traefik-auth-ldap.plugin.ldapAuth.serverList[0].useTLS=true" + #- "traefik.http.middlewares.traefik-auth-ldap.plugin.ldapAuth.baseDN=ou=Users,dc=giorgioravera,dc=it" + #- "traefik.http.middlewares.traefik-auth-ldap.plugin.ldapAuth.attribute=uid" + # Service: Loadbalancer + - "traefik.http.services.traefik.loadbalancer.server.port=9999" + +secrets: + ldap_auth_cache_key: + file: ./secrets/ldap_auth_cache_key -- 2.47.3