]> git.giorgioravera.it Git - docker.git/commitdiff
Added traefik configuration for network
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 16 Jun 2026 12:26:59 +0000 (14:26 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 16 Jun 2026 12:26:59 +0000 (14:26 +0200)
traefik/docker-compose_network.yaml [new file with mode: 0644]

diff --git a/traefik/docker-compose_network.yaml b/traefik/docker-compose_network.yaml
new file mode 100644 (file)
index 0000000..808e0aa
--- /dev/null
@@ -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