Alpine Linux or Debian images providing Python, gunicorn, and FastAPI.
10K+
A base Docker image for microservices using FastAPI. The Docker image environment is based on Debian and provides a Python environment with FastAPI, gunicorn, and uvicorn workers acting as an Asynchronous Server Gateway Interface (ASGI).
What is special about this Docker image? There are two key elements:
pip-compile command from the
pip-tools including package hashes so
that you can recreate the image exactly.midnighter/fastapi-base:3.8-slim-buster_2020-07-03_d517373 That means, if
you use these tags, you know exactly what you are getting.You can combine this deterministic base image with your own in the following ways. A tool like tag-spy can be used to retrieve the latest tag for each image when you build your own.
docker run --rm dddecaf/tag-spy:latest tag-spy midnighter/fastapi-base 3.8-slim-buster
3.8-slim-buster_2020-07-03_d517373
All actual implementations of such microservices should be based on this image
and include the fastapi-requirements in their own requirements. In practice,
their Dockerfile needs to specify:
ARG TAG=3.8-slim-buster_2020-07-03_d517373
FROM midnighter/fastapi-base:${TAG}
and their requirements.in file:
-r /opt/requirements/fastapi-requirements.txt
such that pinned (deterministic) versions are guaranteed.
Images are generated for the following environments. Please open an issue if you require others.
| Tag | Python | Distribution |
|---|---|---|
| 3.8-slim-bookworm | 3.8 | Debian Bookworm |
| 3.9-slim-bookworm | 3.9 | Debian Bookworm |
| 3.10-slim-bookworm | 3.10 | Debian Bookworm |
| 3.11-slim-bookworm | 3.11 | Debian Bookworm |
Content type
Image
Digest
sha256:bd6931301…
Size
57.8 MB
Last updated
about 3 years ago
docker pull midnighter/fastapi-base:3.10-slim-bookworm_2023-08-30_9edcf09