Started from dockerize-your-flask-application
Make sure the app works locally:
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
python app.py
docker build -t flask-tutorial:latest .
or
make build
docker run -d -p 5000:5000 flask-tutorial
or
make run
Note: If you get an error "fixture 'host' not found", then be sure to activate your python virtual environment. (see Development above)
You can also run:
make test
Ensure that we do not have any pylint issues by running:
make lint
make clean
- Create a git pre-commit hook to ensure code committed has some checks:
a. Create .git/hooks/pre-commit
#!/bin/bash
make test
b. Ensure the script is executable:
chmod +x .git/hooks/pre-commit