Skip to main content
FastAPI runs on slipway as a web service on the Python runtime.

Prerequisites

A FastAPI app in a GitHub or GitLab repository, with uvicorn in your requirements.

Add slipway.yaml

slipway.yaml
Bind to 0.0.0.0. Uvicorn defaults to 127.0.0.1, which is unreachable from outside the container.

Add a health endpoint

app/main.py
Keep it cheap. A check that queries the database fails the deploy whenever the database is slow.

Run migrations

slipway.yaml

Workers

For a Uvicorn worker count, prefer running more replicas over more processes in one container, so the platform can balance them:
slipway.yaml
Or autoscale:
slipway.yaml
See Scaling.

Add a background worker

slipway.yaml

Next steps

Secrets

Keep API keys out of the repository.

PR previews

Give every pull request its own copy.