This project deploy a FastAPI application to Azure Container Apps. The FastAPI application is a simple web application for a space travel agency. The application is built using the FastAPI framework and uses a PostgreSQL database with SQLModel as an ORM. The application can be deployed to Azure using the Azure Developer CLI.
This project has Dev Container support, so it will be be setup automatically if you open it in Github Codespaces or in local VS Code with the Dev Containers extension.
If you're not using one of those options for opening the project, then you'll need to:
-
Create a Python virtual environment and activate it.
-
Install production requirements:
python -m pip install -r demo_code/requirements.txt
-
Install the app as an editable package:
python -m pip install -e demo_code
-
Apply database migrations and seed initial data:
python3 demo_code/fastapi_app/seed_data.py
Run gunicorn on the app:
python3 -m gunicorn fastapi_app:app -c demo_code/gunicorn.conf.py
-
Install the development requirements:
python3 -m pip install -r requirements-dev.in playwright install --with-deps
-
Run the tests:
python3 -m pytest