https://github.com/mkinney/flask_web
simple tutorial showing how to use docker for python/flask app
https://github.com/mkinney/flask_web
docker flask python testinfra travis-ci
Last synced: about 1 year ago
JSON representation
simple tutorial showing how to use docker for python/flask app
- Host: GitHub
- URL: https://github.com/mkinney/flask_web
- Owner: mkinney
- Created: 2018-11-09T00:32:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T01:17:11.000Z (over 3 years ago)
- Last Synced: 2024-10-11T17:57:29.869Z (over 1 year ago)
- Topics: docker, flask, python, testinfra, travis-ci
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/mkinney/flask_web)
# Background
Started from [dockerize-your-flask-application](https://runnable.com/docker/python/dockerize-your-flask-application)
# Development
Make sure the app works locally:
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
python app.py
# Build
docker build -t flask-tutorial:latest .
or
make build
# Run
docker run -d -p 5000:5000 flask-tutorial
or
make run
# Test
Open [http://localhost:5000/](http://localhost:5000/)
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
# Lint
Ensure that we do not have any pylint issues by running:
make lint
# Clean
make clean
# Tips
1. Create a git pre-commit hook to ensure code committed has some checks:
a. Create `.git/hooks/pre-commit`
``` bash
#!/bin/bash
make test
```
b. Ensure the script is executable:
chmod +x .git/hooks/pre-commit