wsvincent/djangoforprofessionals

Chapter 1 working directory path in docker-compose.yml

faisalzone opened this issue · 5 comments

Hi William,

https://github.com/wsvincent/djangoforprofessionals/blob/master/ch1-hello/docker-compose.yml

Should the following file path be-
command: python /code/hello/manage.py runserver 0.0.0.0:8000
instead of-
command: python /code/manage.py runserver 0.0.0.0:8000

This is how my directory looks like as per the book-
[ code ]
| - [ hello ]
| - - db.sqlite3
| - - docker-compose.yml
| - - Dockerfile
| - - [ hello_project ]
| - - manage.py
| - - [ pages ]
| - - Pipfile
| - - Pipfile.lock

Similarly in the-
https://github.com/wsvincent/djangoforprofessionals/blob/master/ch1-hello/Dockerfile
Should the WORKDIR, COPY and COPY . be /code/hello instead of /code.

Figured it out. /code actually creates a separate folder within docker :)

Hi, can you kindly help

I run this command like

C:\Users\mirrorneuron\Desktop\code\hello>docker-compose up
However, it does this and hangs for ever. There is no way I can figure out what to do next.

Starting hello_web_1 ... done
Attaching to hello_web_1
web_1 | Watching for file changes with StatReloader
web_1 | Performing system checks...
web_1 |
web_1 | System check identified no issues (0 silenced).
web_1 | June 24, 2020 - 11:01:55

Hi @halfprisoner,

That's what it should do. It means the server is running. You can go to localhost and see your Django project. I recommend adding -d so docker-compose up -d which puts the logs in the background. If you want to not use the -d you just need another command line tab open.

Thanks Vincent, I eventually figured it out. As I am using Windows 8.1 and not 10, So I had to use Docker's default web server @192.168.99.100:8000 and not 127.0.0.1:8000 which I was using through out the tutorial in your book. In Windows 8.1 I couldn't install Docker hub instead installed Docker Toolbox.