uvicorn-poetry-fastapi-project-template

(โ˜… 102)

Cookiecutter project template for starting a FastAPI application. Runs in a Docker container with Uvicorn ASGI server on Kubernetes. Supports AMD64 and ARM64 CPU architectures.

  • .gitignore
  • .pre-commit-config.yaml
  • cookiecutter.json
  • LICENSE
  • poetry.lock
  • pyproject.toml
  • README.md

# Installation Guide

1. Get the code
git clone https://github.com/max-pfeiffer/uvicorn-poetry-fastapi-project-template

Downloads the entire project code from GitHub to your computer.

cd uvicorn-poetry-fastapi-project-template

Moves into the project folder you just downloaded.

2. Docker

Easy Recommended
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker build --tag my-application:1.0.0 .

Builds a runnable image based on the Dockerfile.

docker run -it --rm my-application:1.0.0

Runs the built image as an actual container.

โœ… Run docker compose ps to check the containers are Up. If the README mentions a port, open http://localhost:PORT in your browser.

Pulled directly from this repo's README.

3. Python

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Python 3 On Windows, be sure to check 'Add Python to PATH' during installation.
cookiecutter https://github.com/max-pfeiffer/uvicorn-poetry-project-template

Type this command into your terminal and run it.

poetry install

Installs the libraries listed in pyproject.toml.

poetry run uvicorn --workers 1 --host 0.0.0.0 --port 8000 app.main:app

Type this command into your terminal and run it.

โœ… If it runs without errors and prints output in the terminal, it worked.

Pulled directly from this repo's README.

// repository documentation