I am pretty new to Docker ( and all of the tools ). I am trying to setup a docker machine and container on my mac.
My container contains python web application powered by flask. I am running app with following statement
app.run(host='0.0.0.0', debug=True)
And this is what my docker-compose.yml looks like:
web:
build: .
ports:
- "5001:5001"
volumes:
- .:/volcode
When I try to load page hosted at 5001 (docker-machine-ip:5001), I don't see changes made to web application unless I do a
docker-compose build && docker-compose up
UPDATE:
This is my Dockerfile:
FROM ubuntu:14.04
RUN apt-get -yqq update
RUN apt-get install -yqq python2.7
RUN apt-get install -yqq python-dev
RUN apt-get install -yqq libpq-dev
RUN apt-get install -yqq python-psycopg2
RUN apt-get install -yqq python-pip
ADD . /code
WORKDIR /code
RUN pip install -r server/requirements.txt
CMD python server/src/rest_server.py
Also this is equivalent to hot loading. (debug=True) should reload changed python files.
app.run(host='0.0.0.0', debug=True)
UPDATE 2:
Note that mount point in docker-compose.yml and Dockerfile are different. Having same mount points is resulting in the following error.
python: can't open file 'server/src/rest_server.py': [Errno 2] No such file or directory