Docker Community Forums

Share and learn in the Docker community.

Local development issues and container visibility

(Mezzapelle) #1

My local (pc) development is:

  1. Ubuntu LTS 16.04
  2. Docker version 17.12.0-ce, build c97c6d6
  3. docker-compose version 1.8.0

I’m trying to build a simple web app front end (first container) that talks with a node js back end (second container).
in docker compose file I have two services: web and nodeservice.

When I try to call from web the rest service exposed by nodeservice, I get an error if I use the url nodeservice:3000/api, instead it’s ok when I use localhost:3000/api

The first question is: if this behavior is correct, and I can understand it, how can I do when I deploy it in production (swarm, cluster, …)? That is what I write inside web app html: localhost or nodeservice?

The second question is: which suggestion to local develop such apps like that?

Thanks in advance.

(Joffrey F) #2

Your version of docker-compose is over a year old, which means a lot of things you’ll see in the documentation won’t apply. It’ll also be much easier for people here to help you if you upgrade.

It’s also a good idea to share your Compose file so we can help you identify potential issues with your configuration.

(Mezzapelle) #3

I updated docker-compose to 1.19.0, but the questions remain (see above…).