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,18 @@
|
||||
FROM golang:1.22-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY main.go .
|
||||
RUN go mod init bux-playground 2>/dev/null || true
|
||||
RUN go build -o playground-server main.go
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk add --no-cache ca-certificates docker-cli
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/playground-server .
|
||||
COPY frontend ./frontend
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["./playground-server"]
|
||||
Reference in New Issue
Block a user