(I know others have asked this question before, but I\'m not able to solve the problem using the solutions proposed in other posts, so i figured i would try to post my c
I figured out how to fix the problem. Got some help to fix the docker-compose.yml
, so it looks like this:
docker-compose-yml:
version: "3"
services:
web:
image: user/repo:web
deploy:
resources:
limits:
cpus: "0.1"
memory: 50M
restart_policy:
condition: on-failure
ports:
- "8000:80"
networks:
main:
aliases:
- web
nginx:
image: user/repo:nginx
ports:
- 80:80
links:
- web:web
depends_on:
- web
networks:
main:
aliases:
- nginx
networks:
main:
After this the nginx container actually ran, but it was still not capable of connecting to the web-container. Found out I was able to use both curl web
and curl web -p 8000
to get the page from web, from inside the nginx container. Then I changed the upstream in my nginx.conf
from this
upstream docker-web {
server web:8000;
}
to this:
upstream docker-web {
server web;
}