This is built with Flask, Flask-RESTful and Flask-SQLAlchemy.
- Python 3.x LTS
- Docker v20.10.12+
- Docker Compose v2.2.3+ - other versions see here
- Into the local repository folder, run:
python -m venv venv
- After activate the Python venv
source venv/Scripts/activate
- Update pip package
python -m pip install -U pip
- Installing the Python project's dependency packages
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
- If new or updated dependency package was added in the project structure, the requirements.txt must be updated
pip freeze > requirements.txt
- Open the "flaskr" folder in console with following command:
cd flaskr
- Create a migration repository. If the migrations folder already exists this command is not necessary.
python -m flask db init
- To build a new migration, for example, "Initial migration"
python -m flask db migrate -m "Initial migration."
- Then you can apply the migration to the database:
python -m flask db upgrade
Notes: To see all the commands that are available run this command:
python -m flask db --help
Official documentation for Flask-Migrate
Before run the statements below, edit the value of parameter FLASKR_DEV_DIR in the .env file of the docker folder with the absolute path of flaskr/ project folder in you host and declare absolute path of cloud folder in config_credentials.py file
cd docker
docker-compose build --no-cache
docker-compose up --force-recreate -d ; docker-compose logs -f
# In the project root folder
cd docker
docker-compose down --remove-orphans
- Declare as variable for debugging
export FLASK_ENV=development
export FLASK_APP=app.py
2.Enter the flaskr folder and run
cd flaskr
flask run