Traefik labels lost on every redeploy for Dockerfile-based app on remote server (Swarm mode) #4228
Replies: 2 comments
-
|
Hi @ronishpaudel! I'm Dosu and I’m helping the dokploy team. This is a known issue that has been reported by several users. Here's what's happening and your options: Root cause: For standalone (non-compose) applications, Dokploy routes traffic through Traefik's file provider (YAML configs in When you manually add Swarm labels via This matches issues #3536, #3980, and #3480. A fix was proposed in PR #3873 (using Your best workaround right now: Switch to a Docker Compose deployment instead of a standalone Dockerfile app. With Compose, you can define persistent Traefik labels in the services:
app:
build: .
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.myapp.rule=Host(`yourdomain.com`)"
- "traefik.http.routers.myapp.entrypoints=websecure"
- "traefik.http.routers.myapp.tls.certresolver=letsencrypt"
- "traefik.http.services.myapp.loadbalancer.server.port=3000"
networks:
- dokploy-network
networks:
dokploy-network:
external: trueThis is the intended path for Swarm deployments where you need direct control over labels. The standalone application type currently doesn't have a mechanism to persist Swarm-level Traefik labels across redeployments. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
Facing similar issue, it would be nice to support traefik labels in application deploys |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My Setup:
Staging VPS: Dokploy installed, staging app + Redis deployed here
Remote/Prod Server: Added as a remote server where prod app + Redis deployed here via staging Dokploy
Build type: Dockerfile (Standalone Application)
Deployment mode: Docker Swarm
Traefik: Managed by Dokploy
What I Did
I deployed my production app on a remote server through Dokploy's remote server feature. Since it's a Swarm deployment, Traefik needs specific labels on the service to route traffic correctly. I configured the domain in Dokploy's UI and also tried setting labels via the UI Labels section.
However, every time I hit Rebuild or Redeploy, Dokploy overwrites the service and the Traefik labels are gone. I then have to SSH into the remote server and manually run docker service update to re-add all the Traefik labels. This is the only way to get the site back online after every deploy.
What I Tried
Setting labels in Dokploy UI (Labels section under the app) labels do not survive redeploy, Dokploy overwrites them
Switching to Docker Compose service with deploy.labels in the compose file — attempted this but the labels still did not persist correctly or routing broke
Manual docker service update after every deploy works, but completely defeats the purpose of having a CI/CD pipeline
What I Failed to Achieve
I have not been able to find any way inside Dokploy to make Traefik labels persist automatically across redeployments for a Dockerfile-based Standalone Application on a remote Swarm node. There is no field in the UI to define persistent custom labels for Standalone apps, and the Labels section in the UI gets overridden on every deploy.
Expected Behavior
Traefik labels defined for a Standalone Application (Dockerfile build type) should persist across rebuilds and redeployments without any manual intervention.
Beta Was this translation helpful? Give feedback.
All reactions