1main.py · requirements.txt
pythonfrom fastapi import FastAPI app = FastAPI() @app.get("/") def root(): return {"hello": "onecloud"} # requirements.txt # fastapi # uvicorn[standard]2Start command
Set it in Service settings → Start command, or via the CLI.
bashuvicorn main:app --host 0.0.0.0 --port $PORT3Deploy (pick one)
① Connect GitHub: Project → Add service → GitHub repository (deploys on push) ② From this folder: oc up --wait (builds even without a Dockerfile) ③ Upload a folder or zip in the console: Add service → Upload source
bashoc login oc project create my-app --link oc up --wait