docker-compose.preview.yml (or docker-compose.preview.yaml) in the repository root and injects host ports for the app and db so nginx can route correctly.
Repository
- Repo: python-project-preview-example — replace with your repo URL when published.
Stack
- Framework: FastAPI (Python)
- Database: PostgreSQL (async, SQLAlchemy)
- Cache: Redis
- Config:
.env(DATABASE_URL,REDIS_URL) - Health:
GET /health(DB + Redis status) - Endpoints:
GET /,GET /docs,GET /items,GET /admins, etc. - Seeder:
python -m scripts.seed_admin(optional, run separately or in startup)
Key files
docker-compose.preview.yml (repository root) — required
For Python there is no built-in template, so you must provide a preview compose file. Use service names app and db; do not set host ports—the orchestrator injects them.
Example structure (adjust image/build and env to match your repo):
docker-compose.preview.generated.yml with the injected ports and runs docker compose against that file.
preview-config.yml (optional)
You can still add preview-config.yml for:
health_check_path: e.g./healthbuild_commands: e.g.cp .env.example .envstartup_commands: e.g.python -m scripts.seed_adminenv: extra env vars
framework: python; the presence of docker-compose.preview.yml tells the orchestrator to use your compose file.
Local run and API
See the repo README for:- Venv,
pip install -r requirements.txt DATABASE_URL,REDIS_URLin.envpython -m scripts.seed_admin,uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
/health, /docs, /items, /admins, etc.