This sample project demonstrates how to deploy FastAPI with Defang.
- Download Defang CLI
- (optional) If you are using Defang BYOC, make sure you have properly authenticated your AWS account.
- Open the terminal and type
defang login - Type
defang compose upin the CLI. - Your app will be running within a few minutes.
To run your FastAPI app locally, you'll need to have Docker installed on your machine. You can then run:
docker compose -f compose.yaml -f compose.dev.yaml upThat will start your FastAPI app on http://localhost:8000 with hot reloading enabled.
Title: FastAPI
Short Description: A sample project demonstrating how to deploy FastAPI with Defang
Tags: FastAPI, OpenAPI, Python
Languages: python
