This is my first dockerized Flask app! :)
In requirements.txt I specified the Flask version I want to use.
I've created a Dockerfile with following steps:
- Adding requirements to the container
- Install those requirements
- Copying everything else
- In case I have to build image once again, I'll start with layer that has changed
- If everything stays the same in requirements, this layer will not be build again (this way we are saving a lot of building time)
- Actually, it's copying everything except the things you put in .dockerignore file
- Running my python app
Check out https://hub.docker.com/_/alpine - Linux env
In app.py I simply run Flask app
Commands I used for building image are in commands.txt
You can see printed text in browser http://0.0.0.0:5000/