D
Dokploy4mo ago
Kirill

nginx cant access other services in docker compose stack

Locally my compose stack works normally, but when I deploy it to dokploy nginx container cant access other containers in the network. But other containers can access nginx. Here is my compose file
services:
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
depends_on:
- frontend
- provider
networks:
- frontend
- dokploy-network
ports:
- 80

frontend:...
networks:
- frontend
ports:
- 4321

provider:...
networks:
- frontend
- backend
ports:
- 3000

database:...
depends_on:
postgres:
condition: service_healthy
networks:
- frontend
- backend

postgres:...

networks:
frontend:
backend:
dokploy-network:
external: true
services:
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
depends_on:
- frontend
- provider
networks:
- frontend
- dokploy-network
ports:
- 80

frontend:...
networks:
- frontend
ports:
- 4321

provider:...
networks:
- frontend
- backend
ports:
- 3000

database:...
depends_on:
postgres:
condition: service_healthy
networks:
- frontend
- backend

postgres:...

networks:
frontend:
backend:
dokploy-network:
external: true
Could it be because it whaits to start nginx when other parts of network are ready? It acts as a reverse proxy for local network so it cant be started before other servers are available
No description
2 Replies
Siumauricio
Siumauricio4mo ago
I remember I already answer a similar solution to nginx long time ago and it was related
Kirill
KirillOP4mo ago
I'll try to search for nginx questions naah, nothing relevant

Did you find this page helpful?