Quick Start — Python¶
Deploy a Python (Flask, FastAPI, Django) app from git push to a live HTTPS URL in 5 minutes.
Prerequisites¶
- A Python project (
requirements.txt+ entry point) - Python 3.11+ on your machine (
python3 --version) - The
paasCLI:
If you don't already have a Python project, scaffold a Flask one:
mkdir hello-paas && cd hello-paas
cat > app.py <<'EOF'
from flask import Flask
import os
app = Flask(__name__)
@app.route('/')
def home():
return 'Hello from PaaS Runtime!\n'
if __name__ == '__main__':
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 5000)))
EOF
echo "flask>=3.0" > requirements.txt
echo "gunicorn>=21.0" >> requirements.txt
git init && git add -A && git commit -m "init"
Step 1 — Authenticate¶
This opens your browser for SSO (Keycloak). Token is stored in ~/.config/paas/credentials.toml.
Verify:
Step 2 — Create the app¶
Output:
✓ Created app hello-paas
URL: https://hello-paas.runtime.di2amp.com
Region: eu-fr-1
Plan: free
Git: https://git.di2amp.com/octave/hello-paas.git
Verify the git remote:
$ git remote -v
paas https://git.di2amp.com/octave/hello-paas.git (fetch)
paas https://git.di2amp.com/octave/hello-paas.git (push)
Step 3 — Add a Procfile¶
PaaS uses Buildpacks (Paketo) to build images. You only need a Procfile for process types:
Commit:
Step 4 — Push to deploy¶
You'll see live build logs:
remote: ─────── PaaS Build ───────
remote: → Detected: python (paketo-buildpacks/python)
remote: → Installing Python 3.12.1
remote: → Installing pip 24.0
remote: → Running: pip install -r requirements.txt
remote: → Image: registry.di2amp.com/octave/hello-paas:abc1234
remote: → SBOM: ✓ generated, 23 packages
remote: → CVE scan: ✓ 0 critical, 0 high
remote:
remote: ─────── PaaS Deploy ───────
remote: → Process types: web
remote: → Replicas: 1/1 ready
remote: → Rollout: v1 → v2 (canary 10% → 100%)
remote: → Health: / returns 200 OK
remote: → URL: https://hello-paas.runtime.di2amp.com
remote:
remote: ✓ Deployed in 52s
Step 5 — Verify the app is live¶
The dashboard shows runtime status:
https://ma30.di2amp.com/runtime/dashboard/apps/hello-paas
Next steps¶
Add a managed PostgreSQL¶
DATABASE_URL is injected automatically:
Tail logs¶
Run a one-off command¶
Add a worker process¶
In Procfile:
Then push and scale: