When working on my blood pressure readings app I noticed changes in Flask Don’t Show in Docker Compose automatically. I had to do a docker compose down and then up to see a simple change to one of my HTML template files.
This got me very frustrated and I had to run to the kitchen a brew a nice cup of specialty coffee from Peru.
After brewing my coffee I noticed I change a value in my docker compose file. It was under the environment. I changed the value FLASK_DEBUG: to ‘0’ which turns OFF debug mode. When running you Flask app in debug mode using docker compose you can see instantaneous changes in your browser.
This is my service ‘www’ defined in my docker-compose.yml:
www:
restart: always
build: www/.
depends_on:
db:
condition: service_started
volumes:
- ./www:/opt/www
#- ./www/mbp/templates:/opt/www/templates
env_file:
- ./www/.env
environment:
#have the app run in debug mode. Change to 0 to turn OFF. if you change to 0 you won't see
#instant changes. You will need to restart docker compose down/up
FLASK_DEBUG: 1
I will be posting more details about this app I’m developing in Flask using Docker in the near future. For now, you can contact me and also check my ITPro Helper shop for cool coffee mugs and T-Shirts I design.