Restore Traefik dynamic public_share config and copy it during auto-deploy

This commit is contained in:
Leon Bösche
2026-01-25 03:54:39 +01:00
parent 0311122602
commit 1eae6d5713
2 changed files with 43 additions and 0 deletions

View File

@@ -77,6 +77,19 @@ echo "Restarting flutter-web container..."
cd /opt/traefik
docker-compose up -d --force-recreate flutter-web
# Copy Traefik dynamic configs (public share proxy)
echo "Copying traefik dynamic configs..."
mkdir -p /opt/traefik/dynamic
if [ -d "$DEPLOY_DIR/traefik/dynamic" ]; then
cp -r "$DEPLOY_DIR/traefik/dynamic"/* /opt/traefik/dynamic/ || true
fi
# Reload Traefik to pick up dynamic config
echo "Reloading Traefik..."
cd /opt/traefik
# Try graceful recreate, fallback to restart
docker-compose up -d --no-deps --force-recreate traefik || docker-compose restart traefik
echo "=== Deployment completed successfully at $(date) ==="
# Record deployment time

View File

@@ -0,0 +1,30 @@
http:
middlewares:
public-cors:
headers:
accessControlAllowOrigin:
- "*"
accessControlAllowMethods:
- "GET"
- "HEAD"
- "OPTIONS"
accessControlAllowHeaders:
- "Range"
- "Authorization"
- "Content-Type"
addVaryHeader: true
routers:
public-share-router:
rule: "Host(`www.b0esche.cloud`) && PathPrefix(`/public/`)"
entryPoints:
- websecure
middlewares:
- public-cors
service: public-share-service
tls: {}
services:
public-share-service:
loadBalancer:
servers:
- url: "http://go-backend:8080"
passHostHeader: true