To Reproduce
- Create a stack with a service that has two networks — one internal (for inter-service communication) and the external dokploy network
- Deploy the stack
- Let it sit idle for a day or two, or manually restart the service container
- Hit the site — first request gives 504
- Reload Traefik — works fine after
Current vs. Expected behavior
Current:
After a container restart Traefik picks the internal network IP for routing instead of the external dokploy network IP. Since Traefik can't reach the internal network, all requests time out with 504 until Traefik is reloaded.
Expected:
Traefik should always route via the external dokploy network IP. Auto-injecting traefik.docker.network=<dokploy_external_network> on any service that has Traefik labels would ensure this.
Provide environment information
OS: Ubuntu 25.04
Dokploy: V0.28.7
Which area(s) are affected? (Select all that apply)
Docker Compose
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
When a service is on multiple networks, Traefik's network selection is non-deterministic. It picks whichever Docker reports first, which can change between restarts. Manually adding traefik.docker.network=<external_network> to the service labels fixes it permanently. Dokploy should inject this automatically when generating Traefik labels for multi-network services.
Will you send a PR to fix it?
No
To Reproduce
Current vs. Expected behavior
Current:
After a container restart Traefik picks the internal network IP for routing instead of the external dokploy network IP. Since Traefik can't reach the internal network, all requests time out with 504 until Traefik is reloaded.
Expected:
Traefik should always route via the external dokploy network IP. Auto-injecting traefik.docker.network=<dokploy_external_network> on any service that has Traefik labels would ensure this.
Provide environment information
Which area(s) are affected? (Select all that apply)
Docker Compose
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
When a service is on multiple networks, Traefik's network selection is non-deterministic. It picks whichever Docker reports first, which can change between restarts. Manually adding traefik.docker.network=<external_network> to the service labels fixes it permanently. Dokploy should inject this automatically when generating Traefik labels for multi-network services.
Will you send a PR to fix it?
No