This repository demonstrates how to dockerize and deploy a Flask application to Back4app Containers.
To learn more check out the article.
-
Fork/Clone
-
Create and activate a virtual environment:
$ python3 -m venv venv && source venv/bin/activate
-
Install the requirements:
(venv)$ pip install -r requirements.txt
-
Initialize the database:
(venv)$ python init_db.py
-
Run the server:
(venv)$ flask run
-
Navigate to http://localhost:5000/ in your favorite web browser.
-
Install Docker (if you don't have it yet).
-
Build and tag the image:
(venv)$ docker build -t flask-todo:1.0 .
-
Start a new container:
(venv)$ docker run -it -p 5000:5000 -d flask-todo:1.0
-
Navigate to http://localhost:5000/ in your favorite web browser.