Flask Base Image that is configured with different image tags for local and production. This image is very opinionated; however, not restrictive.
Dockerfile linksThis repository builds 2 variants of images: a local image and a production image.
The local image variant is used to run python flask in an isolated development environment on your local machine.
CMD is set to mix phx.server to run a development server with hot reload.PORT is set to 9000 to align with Nullstone conventions to quickly attach nginx sidecar (example coming soon)ENTRYPOINT is set to a custom entrypoint script that does the following:
mix deps - Allows developer to run docker compose restart app to make changes to dependenciesPOSTGRES_URL is specified, set:
DB_ADAPTER=postgresqlDATABASE_URL=$POSTGRES_URLSQLALCHEMY_DATABASE_URI=$POSTGRES_URLMYSQL_URL is specified, set:
DB_ADAPTER=mysqlDATABASE_URL=$MYSQL_URLSQLALCHEMY_DATABASE_URI=$MYSQL_URLBy default, this image expects a flask app named app in a file named app.py.
If your app is located somewhere else, set WSGI_APP=<filename>.<app-name>.
The production image variant uses gunicorn to run a python flask app in production mode.
PORT is set to 80ENTRYPOINT is set to a custom entrypoint script that does the following:
POSTGRES_URL is specified, set:
DB_ADAPTER=postgresqlDATABASE_URL=$POSTGRES_URLSQLALCHEMY_DATABASE_URI=$POSTGRES_URLMYSQL_URL is specified, set:
DB_ADAPTER=mysqlDATABASE_URL=$MYSQL_URLSQLALCHEMY_DATABASE_URI=$MYSQL_URLContent type
Image
Digest
sha256:2bd1dea93…
Size
22.3 MB
Last updated
about 3 years ago
docker pull nullstone/flask