1
0
forked from wrenn/wrenn
Co-authored-by: Tasnim Kabir Sadik <tksadik92@gmail.com>
Reviewed-on: wrenn/sandbox#8
This commit is contained in:
2026-04-09 19:24:49 +00:00
parent 32e5a5a715
commit d3e4812e46
199 changed files with 24552 additions and 2776 deletions

41
deploy/Caddyfile.dev Normal file
View File

@ -0,0 +1,41 @@
# Sandbox port forwarding: {port}-{sandbox_id}.localhost
# Matches subdomains like 49999-sb-abcd1234.localhost and proxies them
# to the control plane, which inspects the Host header and routes to
# the correct host agent.
#
# NOTE: Wildcard *.localhost DNS resolution requires local setup.
# Option 1: Add entries to /etc/hosts for each sandbox
# Option 2: Use dnsmasq: address=/.localhost/127.0.0.1
# Option 3: Use systemd-resolved (Ubuntu default — *.localhost resolves to 127.0.0.1)
http://*.localhost {
reverse_proxy host.docker.internal:8080
}
# Main entry point: API + frontend
http://localhost {
# API routes — strip /api prefix and proxy to the control plane.
# The frontend calls /api/v1/... which becomes /v1/... at the CP.
handle_path /api/* {
reverse_proxy host.docker.internal:8080
}
# Backend routes served directly (SDK clients, OAuth initiation)
handle /v1/* {
reverse_proxy host.docker.internal:8080
}
handle /openapi.yaml {
reverse_proxy host.docker.internal:8080
}
handle /docs {
reverse_proxy host.docker.internal:8080
}
handle /auth/oauth/* {
reverse_proxy host.docker.internal:8080
}
# Everything else — proxy to the frontend dev server
# This includes: /login, /dashboard/*, /admin/*, /auth/github/callback
handle {
reverse_proxy host.docker.internal:5173
}
}

View File

@ -10,24 +10,19 @@ services:
volumes:
- pgdata:/var/lib/postgresql/data
redis:
image: redis:7-alpine
keydb:
image: eqalpha/keydb:alpine
ports:
- "6379:6379"
prometheus:
image: prom/prometheus:latest
caddy:
image: caddy:2-alpine
ports:
- "9090:9090"
- "8000:80"
volumes:
- ./deploy/prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana:latest
ports:
- "3001:3000"
environment:
GF_SECURITY_ADMIN_PASSWORD: admin
- ./Caddyfile.dev:/etc/caddy/Caddyfile:ro
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
pgdata: