https://github.com/jayrbolton/py_microapi_template
Boilerplate for a minimalistic Python microservice with docker
https://github.com/jayrbolton/py_microapi_template
Last synced: 2 months ago
JSON representation
Boilerplate for a minimalistic Python microservice with docker
- Host: GitHub
- URL: https://github.com/jayrbolton/py_microapi_template
- Owner: jayrbolton
- License: mit
- Created: 2018-11-26T21:10:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-26T21:21:04.000Z (over 6 years ago)
- Last Synced: 2025-01-04T23:41:25.529Z (4 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Template micro-API
This is a template Python microservice that uses Docker, docker-compose, Python, Flask, gunicorn, and gevent. It has a set of boilerplate that I like to use for running the server and running tests.
## Set up
Run `docker-compose up` to start the server. Run `make test` in another terminal to run tests.
The server code is in `src/server.py`.
`Dockerfile` will run the server with Alpine and Python 3.7 on port 5000.
## Howto
- Add new pip requirements: add them to `requirements.txt` or `dev-requirements.txt`
- Add new API endpoints: add them to `src/server.py`
- Change how the server boots: modify `scripts/start_server.sh`
- Change how the tests run: modify `scripts/run_tests.sh`
- Add extra services for testing: add them to `docker-compose.yaml`
- Automatically deploy to docker hub using `hooks/build`: enable integration from docker hub
- Enable CI tests: enable the integration from the Travis dashboard for your repo (see `./.travis.yml`)