Skip to content

Repository files navigation

Example fastapi application

New setup with good practices.

Requirements

uv and docker installed.

To have best practices in our code, we are going to run a git pre-commit. Install it via uvx pre-commit install.

Developing locally

Edit the files while running uv run fastapi dev. The API will auto-reload.

Packaging with docker

I've provided two different files for optimal image size.

docker build -t myapi:latest .
# Two stage build: only pull run dependencies in the final image
docker build -t myapi:optimal --file Dockerfile.optimized .

docker run -p 8000:8000 myapi:latest

About

Example repo with a python fastapi build with good practices.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages