Deploy Python
A virtual environment per release, created as the project user.
Choose a launcher
| Mode | Entry | Dependency |
|---|---|---|
| Script | main.py / src/server.py | Application dependencies |
| ASGI | app.main:app | uvicorn + framework |
| WSGI | app:app / project.wsgi:application | gunicorn + framework |
For Web, script mode reads PORT/HOST and ASGI/WSGI use fixed loopback/port arguments. For Worker, only script mode is supported; no HTTP probe or PORT/HOST injection is applied. Select requirements.txt, an installable pyproject.toml, or no dependencies for standard-library scripts.
Host preparation and rollback
Verify /usr/bin/python3 and python3-venv first; Certbot’s Python dependency is not proof that venv support is installed. The helper creates .venv at the final release path, drops to the dedicated non-root uid/gid and runs pip there. It runs pip check and starts the service; Web uses configured HTTP checks and Worker uses process stability checks. A retained release reuses its venv on rollback. Local source preflight without the helper is not a completed HTTP check.
When to use Compose
Private package indexes, extra OS libraries, Poetry/uv-specific lockfile installation and arbitrary migration/pre-start commands are not configured by this native contract. Use a trusted Compose stack for those requirements. Do not use sudo pip or install dependencies globally.