Python
Deploy a Python application (FastAPI + SQLAlchemy + Alembic) that connects to PostgreSQL.
Assumed Structure
- Entry point:
python/main.py, started viapython main.py - The app starts Uvicorn internally
- DB schema managed with Alembic
- Set your dependency install command explicitly in Setup Command (for example:
pip install -r requirements.txt,poetry install --no-dev --no-interaction,pipenv install --deploy --system,uv sync --frozen)
Deploy Commands
| Field | Value (example) |
|---|---|
| Setup Command | pip install -r requirements.txt (or poetry install --no-dev --no-interaction / pipenv install --deploy --system / uv sync --frozen) |
| Pre-deploy Command | alembic upgrade head |
| Start Command | python main.py |
All commands run from the repository root (or selected root directory). Dependency installation is not automatic; set it in Setup Command.
Environment Variables
The PORT environment variable is set by default. Your app should use this value as the listen port.
When a database is selected during app creation, the following variables are also automatically set:
DB_HOST,DB_PORT,DB_NAME,DB_USER,DB_PASSWORDDATABASE_URL— full connection string
Starter App
See the starter app for reference: kamui-project/python-starter