jpbruinsslot / docker-django

A project to get you started with Docker and Django.
MIT License
179 stars 62 forks source link

Nginx server can't connect with webapp container #14

Closed rumski20 closed 5 years ago

rumski20 commented 7 years ago

I'm trying to use this setup with an existing django project. I've mounted my code as a volume in the webapp directory at <local_dir>:/srv/<project_name>.

When I run docker-compose up -d I get the following error straight away in the logs:

webserver_1  | 2017/09/26 15:13:35 [emerg] 8#8: host not found in upstream "webapp:8000" in /etc/nginx/nginx.conf:19
webserver_1  | nginx: [emerg] host not found in upstream "webapp:8000" in /etc/nginx/nginx.conf:19

And then both the webapp and webserver containers exit without reporting anything further in the logs.

Any ideas how to improve the logging for the purposes of debugging, or what might be happening here?

jpbruinsslot commented 7 years ago

I'll have a look over the weekend to see what was is happening

bartkim0426 commented 6 years ago

same issue here too..

bartkim0426 commented 6 years ago

I recognized that I didn't have static-files dir in root dir, so I deleted static-files volumes in webserver, and webapp. then that error gone. I wish it helps

jpbruinsslot commented 5 years ago

This could be that the webapp, and/or db containers are not yet running. You can solve it by individually starting the containers.