All Projects → leafney → docker-flask

leafney / docker-flask

Licence: other
Alpine + Docker + Flask + Gunicorn + Supervisor

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to docker-flask

drupal
Vanilla Drupal docker container image
Stars: ✭ 19 (+18.75%)
Mutual labels:  alpine
alpine-php-wordpress
Wordpress running on Alpine Linux [Docker]
Stars: ✭ 30 (+87.5%)
Mutual labels:  alpine
alpine-grav
Grav running on Alpine Linux [Docker]
Stars: ✭ 14 (-12.5%)
Mutual labels:  alpine
docker-jre
Lean JRE 8 Docker container
Stars: ✭ 25 (+56.25%)
Mutual labels:  alpine
dcos-k8s-rust-skaffold-demo
A demo of pipelining Rust application development to Kubernetes on DC/OS with Skaffold.
Stars: ✭ 40 (+150%)
Mutual labels:  alpine
rapide
WIP! do not use just yet - Opinionated Vite + Alpine.js starter PWA template
Stars: ✭ 15 (-6.25%)
Mutual labels:  alpine
docker-java-node
🐳 OpenJDK JRE or JDK (8,11 or 17) with Node.js 14 LTS (Fermium) or 16 LTS (Gallium) Docker image
Stars: ✭ 56 (+250%)
Mutual labels:  alpine
packages
Cloud Posse DevOps distribution of linux packages for native apps, binaries, alpine packages, debian packages, and redhat packages.
Stars: ✭ 107 (+568.75%)
Mutual labels:  alpine
docker-geoserver
A basic docker geoserver image with JAI and marlin renderer running on tomcat
Stars: ✭ 17 (+6.25%)
Mutual labels:  alpine
docker-alpine-gcc
The smallest Docker image with C compiler (GCC) (130MB)
Stars: ✭ 48 (+200%)
Mutual labels:  alpine
drupal-php
PHP docker container image for Drupal
Stars: ✭ 56 (+250%)
Mutual labels:  alpine
docker-alpine-bash
Docker image with Bash and complete utils (busybox replacements) (10MB)
Stars: ✭ 25 (+56.25%)
Mutual labels:  alpine
dockerfiles-nginx-auth-ldap
Nginx on Alpine with LDAP authentication module from kvspb/nginx-auth-ldap
Stars: ✭ 25 (+56.25%)
Mutual labels:  alpine
mage2docker
A performant, replicable, and production-like alpine Magento 2 local development environment that leverages Docker.
Stars: ✭ 37 (+131.25%)
Mutual labels:  alpine
docker-nagios
Docker image for Nagios Core in Alpine Linux with basic plugins, available for x86, x64 , ARM v6, ARM v7 and ARM64.
Stars: ✭ 33 (+106.25%)
Mutual labels:  alpine
docker flutter
Alpine Linux image for Flutter & Dart with helpful utils and web build support.
Stars: ✭ 33 (+106.25%)
Mutual labels:  alpine
alpinist
Automatic Alpine Linux Package (apk) Repository Generation using AWS Lambda, S3 & SSM Parameter Store
Stars: ✭ 45 (+181.25%)
Mutual labels:  alpine
docker-base
Just enough to get process supervision and startup mechanisms
Stars: ✭ 25 (+56.25%)
Mutual labels:  alpine
docker-aws-s3-sync
Docker container to sync a folder to Amazon S3
Stars: ✭ 21 (+31.25%)
Mutual labels:  alpine
alpine-buildpack-deps
An attempt at a "buildpack-deps"-like Docker image with Alpine Linux
Stars: ✭ 30 (+87.5%)
Mutual labels:  alpine

docker-flask

Alpine + Docker + Flask + Gunicorn + Supervisor

The image by Gunicorn deployment Flask under alpine system application, and through the Supervisor management example of a background process.

Base image is alpine:3.5

Get image from Docker Hub

$ docker pull leafney/docker-flask

Start a default background running container

$ docker run -it --name flask -d -p 5000:5000 leafney/docker-flask

you can see it in browser by http://yourhostip:5000 .


Start a background container and mount the directory to the container

Mounted under the host directory /home/tiger/flaskweb into the container /web:

$ docker run --name flask -v /home/tiger/flaskweb:/app -d -p 5000:5000 leafney/docker-flask

The current directory under the /app folder to mount the directory flaskweb:

- flaskweb
	- conf
		- supervisor_flask.ini
	- logs
	- web
		- app.py

File supervisor_flask.ini is used to set the supervisor boot parameters and Gunicorn settings.

Put your project files in the web directory,app.py is the startup file for your Flask project. And need to set up in the app.py monitoring open IP.

if __name__ == '__main__':
    app.run(host='0.0.0.0')

And then through the command $ docker restart flask to restart container.


Installing additional flask packages

The base dependency package is only installed in the Flask container. In the actual project, you also need to install other dependencies. You can install dependencies in the running Flask container by following commands:

$ docker exec CONTAINER_ID/NAME /bin/sh -c "pip install package-name"

For example, the project uses the mongodb database, you can install the following commands:

$ docker exec flask /bin/sh -c "pip install Flask-PyMongo"

After the installation is completed through the command $ docker restart flask to restart container.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].