https://github.com/jedirhymetrix/hold-my-flask
Instantly turn your Python-Flask application into a production-ready docker container.
https://github.com/jedirhymetrix/hold-my-flask
api backend deployment docker docker-compose flask production-ready python quick template webserver
Last synced: 3 months ago
JSON representation
Instantly turn your Python-Flask application into a production-ready docker container.
- Host: GitHub
- URL: https://github.com/jedirhymetrix/hold-my-flask
- Owner: JediRhymeTrix
- License: mit
- Created: 2021-05-18T08:18:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-04T19:49:03.000Z (about 4 years ago)
- Last Synced: 2025-07-11T02:16:43.715Z (about 1 year ago)
- Topics: api, backend, deployment, docker, docker-compose, flask, production-ready, python, quick, template, webserver
- Language: Dockerfile
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hold My FLASK
_What's in your **Flask**? It could be Whiskey or Gin 🍸. But if it's an **API** in need of some TLC to reach it's true potential 🚀, then this is what you need!_
Instantly turn your Python-Flask application into a production-ready docker container.
No more writing and maintaining `Dockerfile` or `docker-compose`
Automatically adds and configures the following in your container so you don't have to:
- **gunicorn** for scalability
- **nginx** for routing
- **supervisord** for monitoring
Place your files inside `/app`. \
Get up and running with a single command:
```bash
docker-compose up
```
Now, if anyone asks you to quickly create and deploy a scalable Flask app, all you have to say is **"Hold My FLASK"**!
## Prerequisites
[Docker](https://docs.docker.com/get-docker/)
[docker-compose](https://docs.docker.com/compose/install/)
## Full Instructions
1. Place your Flask app files into the `app` directory. Use the name `app.py` for your app's entry point or change the filename in `configs/supervisord.conf`. (skip to step #5 to use defaults)
2. Set the version tag on the first line of `Dockerfile` to your desired Python version. (**3.9** by default)
3. (Optional) Make changes to **gunicorn**, **nginx** and **supervisord** config files in `/configs` as needed.
4. (Optional) Use a file "`app/utils/prep.py`" to run python setup scripts such as downloading sklearn models and uncomment the respective line in `Dockerfile` to run the scripts before starting the server.
5. Finally, run the following set of command to build and run the docker container:
```bash
docker-compose up
```