- In the Dashboard, click Create Project +
- Under Pick Components, choose FastAPI. Here you can also add a frontend framework to create a monorepo app, eg, FastAPI for backend and React+Vite for frontend
- In Pick Add-ons, you can add one or multiple databases to your app
- Choose Create Repository to generate a new GitHub repo
- Finally, click Launch Stack
For more details, check https://diploi.com/blog/hosting_fastapi_apps
During development, the container installs Node.js and nodemon
to enable automatic reloads when files change. The development server is started with:
nodemon --delay 1 --watch pyproject.toml --exec uv run --isolated uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload
This will:
- Use nodemon to watch for changes to pyproject.toml and restart the server when changes are detected.
- Run the command uv run --isolated uvicorn src.main:app --host 0.0.0.0 --port 8000 --reload in an isolated Python environment.
- Start the FastAPI app using uvicorn on all network interfaces at port 8000.
- Enable hot-reload via uvicorn --reload, so the server automatically restarts when Python source files change.
Builds a production-ready image. During the build, dependencies are installed with uv sync
. When the container starts, it runs:
fastapi run src/main.py --proxy-headers --port 8000
This uses the FastAPI CLI to serve your application on port 8000.