TEMPLATE - Production-ready Python template
Minimal boilerplate to bootstrap a production-oriented Python service.
Quickstart
- Create a virtualenv and install dependencies:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt- Run the app in development:
$env:PYTHONPATH = '.'
uvicorn --factory src.app.factory:create_app --reload --port 8000- Run tests and linters:
$env:PYTHONPATH = '.'
ruff check .
pytest -qDocumentation
Extended documentation is in the docs/ folder. See docs/README.md for details.
Deployment notes
- Use
.envonly for local Compose. SetENV_FILE=.envlocally when you want Compose services to load it. The Docker image excludes.env; set production secrets in the platform panel. - Coolify deployments should use
POSTGRES_INTERNAL_PORT=5432for container-to-container traffic andPOSTGRES_HOST_PORTonly for optional host exposure. - Production proxy deployments should set
ENV=production,FORCE_HTTPS=true, andSESSION_COOKIE_SECURE=true. - See docs/DEPLOYMENT.md and troubleshooting-coolify.md.