How it works
pip install -r requirements.txt runs at build time and uvicorn starts on $PORT with --proxy-headers, so request.url shows https behind the Rebasable edge. /healthz is the health check and /docs is the interactive API reference.
Run it locally
python -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload # http://localhost:8000/docs
Use it as your own repository
Copy the fastapi folder of the templates repository into a new repo (the files at the root, rebasable.yaml included) and push it. Then add a Deploy button to its README, or create it from Blueprints, New blueprint in the dashboard. From then on, every push deploys, and pull requests get preview environments.
Good to know
- More throughput: raise the instance type and add
--workers 2(each worker uses its own memory). - Background jobs: add a
type: workerservice with the same repo and a differentstartCommand.