Symfony 4 app works with Docker Compose but breaks with Docker Swarm (no login, profiler broken) Symfony 4 app works with Docker Compose but breaks with Docker Swarm (no login, profiler broken) docker docker

Symfony 4 app works with Docker Compose but breaks with Docker Swarm (no login, profiler broken)


Maybe it's not your specific case, but it could help some user who have problems using Docker Swarm which are not present in Docker Compose.

I've been fighting this issue for over a week. I found that the default network for Docker Compose uses the bridge driver and Docker Swarm uses Overlay.

Later, I read in the Caveats section in the Postgres Docker image repo that there's a poblem with the IPVS connection timeouts in overlay networks and it refers to this blog for solutions.

I try with the first option and changed the endpoint_mode setting to dnsrr in my docker-compose.yml file:

db:    image: postgres:12    # Others settings ...    deploy:        endpoint_mode: dnsrr

Keep in mind that there are some caveats (mentioned in the blog) to consider. However, you could try the other options.

Also in this issue maybe you find something useful as they faced the same problem.