{"id":19221001,"url":"https://github.com/midnighter/fastapi-base","last_synced_at":"2025-05-13T01:13:55.208Z","repository":{"id":138076662,"uuid":"183703781","full_name":"Midnighter/fastapi-base","owner":"Midnighter","description":"A base Docker image for microservices using FastAPI. The Docker image environment is based on Alpine Linux or Debian.","archived":false,"fork":false,"pushed_at":"2025-04-29T11:03:43.000Z","size":403,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"stable","last_synced_at":"2025-05-13T01:13:49.313Z","etag":null,"topics":["alpine-image","asgi","debian-image","docker","fastapi","microservices","py38","python","starlette"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/midnighter/fastapi-base","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Midnighter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-04-26T23:02:04.000Z","updated_at":"2025-04-29T11:03:46.000Z","dependencies_parsed_at":"2023-11-14T12:25:15.741Z","dependency_job_id":"7f58cb35-d570-4630-90bf-65aebb728acd","html_url":"https://github.com/Midnighter/fastapi-base","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Midnighter%2Ffastapi-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Midnighter%2Ffastapi-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Midnighter%2Ffastapi-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Midnighter%2Ffastapi-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Midnighter","download_url":"https://codeload.github.com/Midnighter/fastapi-base/tar.gz/refs/heads/stable","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253851072,"owners_count":21973674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine-image","asgi","debian-image","docker","fastapi","microservices","py38","python","starlette"],"created_at":"2024-11-09T14:39:40.904Z","updated_at":"2025-05-13T01:13:55.181Z","avatar_url":"https://github.com/Midnighter.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI-Base\n\n[![Docker Image CI](https://github.com/Midnighter/fastapi-base/workflows/Docker%20Image%20CI/badge.svg)](https://github.com/Midnighter/fastapi-base/actions)\n[![Docker image pulls](https://img.shields.io/docker/pulls/midnighter/fastapi-base)](https://hub.docker.com/r/midnighter/fastapi-base)\n[![License](https://img.shields.io/badge/license-Apache--2.0-blueviolet)](https://opensource.org/licenses/Apache-2.0)\n\nA base [Docker](https://www.docker.com/) image for microservices using\n[FastAPI](https://fastapi.tiangolo.com/). The Docker image environment is based\non [Debian](https://www.debian.org/) and provides a Python environment with\nFastAPI, [gunicorn](https://gunicorn.org/), and [uvicorn\nworkers](https://www.uvicorn.org/) acting as an [Asynchronous Server Gateway\nInterface (ASGI)](https://asgi.readthedocs.io/en/latest/).\n\n## Design\n\nWhat is special about this Docker image? There are two key elements:\n\n1. The image is completely deterministic in the sense that all Python\n   dependencies are pinned exactly using the `pip-compile` command from the\n   [pip-tools](https://pypi.org/project/pip-tools/) including package hashes so\n   that you can recreate the image exactly.\n2. Every week, a [cron job](.github/workflows/cron-upgrade.yml) re-compiles the\n   dependencies and if they changed, commits them.\n3. When the dependencies change, the image is\n   [re-built](.github/workflows/docker-image-ci.yml) and tagged with the\n   information shown below, with the date of creation, and the short version of\n   the commit hash, for example, `midnighter/fastapi-base:3.8-slim-buster_2020-07-03_d517373` That means, if\n   you use these tags, you know _exactly_ what you are getting.\n\n## Usage\n\nYou can combine this deterministic base image with your own in the following\nways. A tool like tag-spy can be used to retrieve the latest tag for each image\nwhen you build your own.\n\n```\ndocker run --rm dddecaf/tag-spy:latest tag-spy midnighter/fastapi-base 3.8-slim-buster\n\n3.8-slim-buster_2020-07-03_d517373\n```\n\nAll actual implementations of such microservices should be based on this image\nand include the fastapi-requirements in their own requirements. In practice,\ntheir `Dockerfile` needs to specify:\n\n```dockerfile\nARG TAG=3.8-slim-buster_2020-07-03_d517373\n\nFROM midnighter/fastapi-base:${TAG}\n```\n\nand their `requirements.in` file:\n\n```\n-r /opt/requirements/fastapi-requirements.txt\n```\n\nsuch that pinned (deterministic) versions are guaranteed.\n\n## Python Environments\n\nImages are generated for the following environments. Please [open an\nissue](https://github.com/Midnighter/fastapi-base/issues/new) if you require\nothers.\n\n| Tag                | Python | Distribution                               |\n| ------------------ | ------ | ------------------------------------------ |\n| 3.8-slim-bookworm  | 3.8    | [Debian Bookworm](https://www.debian.org/) |\n| 3.9-slim-bookworm  | 3.9    | [Debian Bookworm](https://www.debian.org/) |\n| 3.10-slim-bookworm | 3.10   | [Debian Bookworm](https://www.debian.org/) |\n| 3.11-slim-bookworm | 3.11   | [Debian Bookworm](https://www.debian.org/) |\n\n## Copyright\n\n-   Copyright © 2019-23, Moritz E. Beber.\n-   Free software licensed under the [Apache License, Version 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmidnighter%2Ffastapi-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmidnighter%2Ffastapi-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmidnighter%2Ffastapi-base/lists"}