Closed slyapustin closed 8 years ago
The volumes aren't redundant. They are intended to allow continued development. That particular yml file isn't for production.
Yeah, if you want to also update project on host machine and see changes in docker container, you should mount such folders as volume.
I thought there couple important things which need to be mentioned in Readme.md for windows users:
1) using docker exec
, instead of docker run
command
2) mounting host folders for dev purposes https://docs.docker.com/v1.8/userguide/dockervolumes/#mount-a-host-directory-as-a-data-volume
Removing the volumes fixed my issue while running this on Windows.
I am not sure what @inoks meant by:
1) using
docker exec
, instead ofdocker run
command
The guide uses docker-compose which doesn't have exec.
@s7726 and @inoks what are you using for your volumes? I think the web process needs to be updated in the .yml file to:
web:
restart: always
build: ./web
expose:
- "8000"
links:
- postgres:postgres
- redis:redis
volumes:
- /usr/src/app
- /usr/src/app/static
env_file: .env
command: /usr/local/bin/gunicorn docker_django.wsgi:application -w 2 -b :8000
So the volumes should be:
volumes:
- /usr/src/app
- /usr/src/app/static
Thoughts?
It depends on your goal. The way the docker_compose.yml is written is for testing. Look at the production.yml for something for production. No need to list the volumes at all in the production one. The files are copied over in the Docker file.
@inoks:
Can you update the PR to:
volumes:
- /usr/src/app
- /usr/src/app/static
Removed redundant volumes mount, which cause project folder to be inacessible