feat: add web playground with Docker sandbox
- playground/backend/main.go — Go HTTP server with /compile endpoint - playground/frontend/index.html — Monaco Editor with 8 code examples - playground/sandbox/Dockerfile — isolated Docker container with buxc2 - playground/docker-compose.yml — orchestrates backend + sandbox - playground/Makefile — build and run targets - playground/README.md — deployment guide for VPS with nginx + SSL
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: backend/Dockerfile
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- PORT=8080
|
||||
- USE_DOCKER=1
|
||||
- SANDBOX_IMAGE=bux-playground-sandbox
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
depends_on:
|
||||
- sandbox
|
||||
restart: unless-stopped
|
||||
|
||||
# Sandbox image is built separately and used by backend
|
||||
sandbox:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: playground/sandbox/Dockerfile
|
||||
image: bux-playground-sandbox
|
||||
# This container is not run directly — backend spawns it per-request
|
||||
command: ["echo", "sandbox image ready"]
|
||||
Reference in New Issue
Block a user