Experimenting with traefik to no avail

This commit is contained in:
2024-08-16 15:51:43 +02:00
parent 9de4e2ac93
commit 9b5c20450d
3 changed files with 163 additions and 137 deletions
+21 -4
View File
@@ -7,9 +7,9 @@ services:
image: traefik:v3.0
ports:
# Listen on port 80, default for HTTP, necessary to redirect to HTTPS
- 80:80
#- 80:80
# Listen on port 443, default for HTTPS
- 443:443
#- 443:443
# Listen on port 8080, traefiks web-ui
- 8080:8080
deploy:
@@ -23,10 +23,10 @@ services:
- traefik.enable=true
# Use the traefik-public network (declared below)
- traefik.docker-network=traefik-public
# User the custome label "traefik.constraint-label=traefik-public"
# Use the custome label "traefik.constraint-label=traefik-public"
# This public Traefik will only use services with this label
# That way you can add other internal Traefik instances per stack if needed
- traefik.constraint-label=traefik-public
#- traefik.constraint-label=traefik-public
# admin-auth middleware with HTTP Basic auth
# Using the environment variables USERNAME and HASHED_PASSOWRD
- traefik.http.middlewares.admin-auth.basicauth.users=${USERNAME?Variable not set}:${HASHED_PASSWORD?Variable not set}
@@ -57,7 +57,12 @@ services:
- /var/run/docker.sock:/var/run/docker.sock:ro
# Mount the volume to store the certificates
- traefik-public-certificates:/certificates
# Mount the volume to store logs
- traefik-logs:/logs
# Mount the directory where rules are saved
- /data/share/traefik/rules:/rules
command:
- --global.checkNewVersion=true
# Enable Docker in Traefik, so that it reads labels from Docker services
- --providers.docker
# Add a constraint to only use services with the label "traefik.constraint-label=traefik-public"
@@ -84,6 +89,15 @@ services:
- --api=true
- --api.dashboard=true
- --api.insecure=true
- --log=true
- --log.filePath=/logs/trafeik.log
- --log.level=INFO
- --accessLog=true
- --accessLog.filePath=/logs/access.log
- --accessLog.bufferingSize=100
- --accessLog.filters.statusCodes=204-299,400-499,500-599
- --providers.file.directory=rules
- --providers.file.watch=true
networks:
# Use the public network created to be shared between Traefik and
# any other service that needs to be publicly available with HTTPS
@@ -94,6 +108,9 @@ volumes:
# Traefik is always deployed to the same Docker node with the same volume containing
# the HTTPS certificates
traefik-public-certificates:
driver: local
traefik-logs:
driver: local
networks:
# Use the previously created public network "traefik-public", shared with other