Docker image with gunicorn and nginx for web applications written in the latest stable version of Python (currently 3.12).
This Docker image will allow creation of Python web applications running under gunicorn and NGinx.
Built on the alpine branch of the official python docker distribution it is intended as a lightweight container that implements signal handling correctly (via runit)and tracks the latest release of python for development and occasional deployment.
It includes the postgres and mariadb libraries so that python database libraries can be installed - these can be stripped out for a smaller image.
By default the container expects the app to be in a directory '/app'. This can
be overridden with the APPDIR environment variable
ENV APPDIR /applicationBy default an app called main:app in the directory /app is executed
this can be specified and overridden with the MODULE_APP
environment variable.
ENV MODULE_APP myapp:appBy default the container will launch a number of gunicorn workers equal to
cpus + 1 this can be overriden using the CONCURRENCY environment
variable.
ENV CONCURRENCY 4In this image, Nginx is configure to allow a maximum upload file size of 1M.
This can be specified and over-ridden using the variable NGINX_MAX_UPLOAD
ENV NGINX_MAX_UPLOAD 2mThis project is licensed under the terms of the Apache license.