Skip to content

About

Online GDB: sandboxed code execution in ephemeral, resource-capped Docker containers (Spring Boot, React, Redis Pub/Sub, WebSockets)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Architecture

  • Frontend: React + Monaco Editor (localhost:5173)
  • Backend: Spring Boot (localhost:8081) — runs on host, not containerized
  • Redis: containerized via Docker Compose — used for Pub/Sub result delivery
  • Execution sandbox: each code submission runs in an ephemeral, resource-capped Docker container (--memory, --cpus, --pids-limit, --network=none), destroyed immediately after execution

Known limitations / scope decisions

  • Backend runs on host, not in a container. In a full production setup, the backend would also run in a container with the host's Docker socket (/var/run/docker.sock) mounted in, allowing it to spawn sibling sandbox containers. This was intentionally scoped out here: once the backend itself is containerized, host-to-container path translation for the sandbox volume mounts becomes significantly more complex (host paths must resolve correctly from the Docker daemon's perspective, not the backend container's filesystem), especially across Windows/Linux dev environments. Running the backend directly on the host sidesteps this without changing the core sandboxing design.

  • Docker-socket mounting is itself a security tradeoff. Giving any container access to the host's Docker socket effectively grants it host-level privileges, since it can ask the Docker daemon to do anything — including mounting the host filesystem into a new container. Production systems needing stronger isolation typically use gVisor or Firecracker microVMs instead of raw Docker for the untrusted-code sandbox layer.

  • Redis Pub/Sub does not persist messages. If a client's WebSocket isn't already connected and registered for a job at the exact moment that job's result publishes, the message is lost with no retry. A production version would add a job-status polling fallback (e.g., GET /api/job/{jobId}) or swap Pub/Sub for a durable queue.

About

Online GDB: sandboxed code execution in ephemeral, resource-capped Docker containers (Spring Boot, React, Redis Pub/Sub, WebSockets)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages