Open QuerQue opened 3 years ago
I noticed the same thing.
It's the fact of mapping the volume that will take the local files (it doesn't matter if we use the image or the local build). And so changes to app.py will also be applied in the container (but won't be visible until the app has restarted).
It's actually passing the "DEBUG=True" variable that allows Flask to restart automatically when a change is made.
Hi, I went through this great course but I have a doubt in one section. After making changes in app.py (adding /hello routing) and no changes in docker compose yaml file. I was surprised when run
docker-compose run web bash
because it turned out that changes are visible in /opt/flask-app/app.py (of course container build based on image) I thought that maybe this is due to using different docker-compose version. So I installed 1.21.2 version. The result was the same. After more and more tests I came to conclusion that volumes is the option which makes problem.To sum up. No matter if we have
build: .
orimage: prakhar1989/foodtrucks-web
. If there is a volume pointing to our host app.py changes will be visible and curl request to 0.0.0.0:5000/hello returns Hello World.@prakhar1989 please take a look and if this description above is not correct let me know. Thank you :)