DEV Community

Discussion on: Learn Docker — from the beginning, part V Docker Compose, variables, volumes, networks and databases

Collapse
 
thiago_tgo90 profile image
Thiago Oliveira

Hi, tks for these articles. They are very helpful.

Running the example from your repo (github.com/softchris/docker-compos...) I had a problem when I tried to start the containers.

When I run the code the way it is, I got the following error in the console (I increased the default timeout. Thought maybe it would be the problem):

wait-for-it.sh: timeout occurred after waiting 60 seconds for db:8000

When I update the compose file to use the container db port instead of the one mapped in the host, it works:

wait-for-it.sh: db:3306 is available after 7 seconds

I think, it kinda makes sense because one container will be talking to the other one without using the host (maybe?)

Sorry if you explained/fixed this and I missed the piece.

tks a lot.

Collapse
 
softchris profile image
Chris Noring

hi Thiago.
Thanks for writing this. I'm trying to understand what kind of OS you are on, linux, mac, windows? Just trying to rule out if it is OS dependent or not?

Collapse
 
thiago_tgo90 profile image
Thiago Oliveira

Hi Cris

I'm using Ubuntu 18.04.2 LTS and Docker (Client and Host) 18.03.1-ce

Thank you.

Collapse
 
bijoy26 profile image
Anjum Rashid • Edited

I ran into same timeout issue as Thiago on Windows host and solved it by updating the internal DB port as instructed.

However, then I stumbled upon following issue on the product-service container:

sh: nodemon: command not found

Few hours of head scratching and unhealthy debugging later, the culprit turned out to be bind mount wiping out the node_modules directory. Got a workaround with this solution.

Better late than never!

Collapse
 
softchris profile image
Chris Noring

thank you for lettting me know. I'm sure someone else will scratch their head here and see your comment