https://github.com/evryfs/base-python-asgi
Python base image with ASGI server
https://github.com/evryfs/base-python-asgi
Last synced: 6 months ago
JSON representation
Python base image with ASGI server
- Host: GitHub
- URL: https://github.com/evryfs/base-python-asgi
- Owner: evryfs
- Created: 2019-12-06T09:12:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-06-02T08:11:32.000Z (about 1 year ago)
- Last Synced: 2025-06-18T23:40:46.636Z (about 1 year ago)
- Language: Dockerfile
- Size: 77.1 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python ASGI base image
[](https://quay.io/repository/evryfs/base-python-asgi)
This image forms the basis for running python ASGI applications. It is based on
the Tietoevry python base image and uses uvicorn.
## Usage
The image bundles a wrapper script for uvicorn at `/bin/start_uvicorn`. It uses
environment flags to control how the ASGI application is started.
### Available flags
| Flag | Default | Comment |
| ----------------- | ------- | ----------------------------------------- |
| UVICORN_PORT | 8000 | Application port. |
| UVICORN_HOST | 0.0.0.0 | Application bind address. |
| UVICORN_LOG_LEVEL | info | Set uvicorn log level. |
| CONTEXT_ROOT | None | Context root where application is served. |
### Creating a Dockerfile
To utilize this image to create a container for your application, create a new
Dockerfile based on this. Then add your python sauce to the container and set
the name of the ASGI module with `CMD ["module:callable"]`.
```dockerfile
FROM quay.io/evryfs/base-python-asgi:3.13-stable
ARG BUILD_DATE
ARG BUILD_URL
ARG GIT_URL
ARG GIT_COMMIT
LABEL maintainer="Your Name "
com.finods.ccm.system=""
com.finods.ccm.group=""
org.opencontainers.image.title=""
org.opencontainers.image.created=$BUILD_DATE
org.opencontainers.image.authors=""
org.opencontainers.image.url=$BUILD_URL
org.opencontainers.image.documentation=""
org.opencontainers.image.source=$GIT_URL
org.opencontainers.image.version=""
org.opencontainers.image.revision=$GIT_COMMIT
org.opencontainers.image.vendor="Tietoevry Banking"
org.opencontainers.image.licenses="proprietary-license"
org.opencontainers.image.description=""
COPY . .
CMD ["asgi_module:app"]
```
The default workdir for this image is /app, so any sauce will be copied there.
Remember to reset WORKDIR to /app, if you do additional steps in your derivative
image. The wrapper scripts depends on the module being either in python's
site-packages or present in the current directory.