A full stack on 1 GB of RAM
Deployed the containerised execution backend on an Azure Ubuntu VM with 1 GB RAM; configured custom swap space and Docker Compose so FastAPI, Redis, Celery and PostgreSQL coexist under memory pressure — the box handles 50+ concurrent sandboxed submissions without a single OOM kill.
HTTPS-only, end to end
Put Caddy in front as the reverse proxy with automated Let’s Encrypt SSL/TLS and locked Azure NSGs to HTTPS-only routing. Tracked down and resolved the CORS and Mixed Content breakage between the Vercel-hosted frontend and the Azure backend.
Isolation by containers
Designed the execution model around per-container CPU/memory limits and Docker-based process isolation, so hostile or buggy submissions can’t touch the host — or each other.
Off the event loop
Used Redis + Celery to offload execution tasks from the FastAPI event loop; submissions become queued jobs instead of blocking coroutines, keeping the API responsive under load.
Zero-trust entry
Validated JWTs against an external JWKS endpoint before processing any execution request — unauthenticated traffic is blocked at the door.
State you can watch
Built a long-polling Next.js client that streams container state transitions into a React terminal UI, with adaptive polling intervals to keep server load down. QUEUED→RUNNING→SUCCESS/ERROR
The receipts
Sustained 81+ RPS with 11ms p95 latency across 51K+ requests on a constrained 1 GB Azure VM — by decoupling heavy execution work through Redis and Celery.