I am unable to get Flask to notice changes to my code and reload, making it super hard to program iteratively.
My system: I am using a PC with Windows 10 Home to run Docker Toolbox (regular docker does not work on Windows 10 Home).
My code:
DockerFile
FROM python:3.4-alpine
RUN pip install flask-security flask-sqlalchemy
RUN pip install requests
ADD . app
WORKDIR /app
RUN pip install -r requirements.txt
ENTRYPOINT ["python3"]
CMD ["app/app.py"]
docker-compose.yml
version: '3'
services:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
app/app.py
from flask import Flask
# Create app
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SECRET_KEY'] = 'super-secret'
# Bcrypt is set as default SECURITY_PASSWORD_HASH, which requires a salt
app.config['SECURITY_PASSWORD_SALT'] = 'super-secret-random-salt'
@app.route("/")
def hello():
return 'hello world'
if __name__ == "__main__":
app.run(host='0.0.0.0', port=5000, debug=True)
(I've edited this a little bit to be concise, and not give away what I'm doing :) )
- Am I doing something wrong?
- If not, I ran into this old ticket for VirtualBox where the situation sounds eerily similar. (https://www.virtualbox.org/ticket/14920) If this is my issue, what is a good solution or workaround? (I'm not looking to buy a new machine or OS)