3d99940658
Sandbox Deployment Platform — Go control plane + agents, NextJS dashboard, nginx reverse proxy. Cross-compile via Docker; deploy via sshpass to 172.18.136.92 (micro) and 172.18.139.186 (gateway). - control-plane: HTTP API, WS hub, SQLite (modernc.org/sqlite) for progress, .log files for log persistence - agent-micro / agent-gateway: alpine:3.20 + bind-mounted repo, binary exec'd in container, no Dockerfile build step - dashboard: NextJS static export + shadcn/ui components, single WebSocket hook - docker-compose.yml: three services on alpine:latest with docker socket bind for agents - scripts/: build.sh (golang:1.23-alpine cross-compile), deploy.sh, patch-nginx.sh (idempotent nginx splice), ssh wrappers Runtime model: pass-through Bitbucket creds per deploy, never logged or persisted on the agent. Control plane never touches git or docker directly — agents do all the work locally.
63 lines
1.8 KiB
YAML
63 lines
1.8 KiB
YAML
# docker-compose.yml — runs control-plane, agent-micro, agent-gateway
|
|
# inside alpine:latest containers. The agents need the host docker socket
|
|
# bind-mounted so they can manage service containers.
|
|
#
|
|
# Use on a single host (e.g. 186) for dev. In production, the agents
|
|
# live on their own VMs and the control plane lives on 186.
|
|
|
|
services:
|
|
control-plane:
|
|
image: alpine:latest
|
|
container_name: sdp-control-plane
|
|
restart: unless-stopped
|
|
command: ["/SDP/bin/control-plane", "-addr", ":8080", "-data", "/SDP/data"]
|
|
volumes:
|
|
- ./bin/control-plane:/SDP/bin/control-plane:ro
|
|
- sdp-data:/SDP/data
|
|
ports:
|
|
- "8080:8080"
|
|
|
|
agent-micro:
|
|
image: alpine:latest
|
|
container_name: sdp-agent-micro
|
|
restart: unless-stopped
|
|
# agent connects to the control plane by container name on the compose
|
|
# network. Override SDP_CP_URL when running outside compose.
|
|
command:
|
|
- /SDP/bin/agent-micro
|
|
- -node
|
|
- micro
|
|
- -cp
|
|
- ws://control-plane:8080/ws/agent
|
|
volumes:
|
|
- ./bin/agent-micro:/SDP/bin/agent-micro:ro
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
# Repos live on the host. Adjust to the actual paths.
|
|
- ~/AppGolang:/AppGolang:ro
|
|
environment:
|
|
- DOCKER_HOST=unix:///var/run/docker.sock
|
|
depends_on:
|
|
- control-plane
|
|
|
|
agent-gateway:
|
|
image: alpine:latest
|
|
container_name: sdp-agent-gateway
|
|
restart: unless-stopped
|
|
command:
|
|
- /SDP/bin/agent-gateway
|
|
- -node
|
|
- gateway
|
|
- -cp
|
|
- ws://control-plane:8080/ws/agent
|
|
volumes:
|
|
- ./bin/agent-gateway:/SDP/bin/agent-gateway:ro
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- ~/SDP/repos:/SDP-repos:ro
|
|
environment:
|
|
- DOCKER_HOST=unix:///var/run/docker.sock
|
|
depends_on:
|
|
- control-plane
|
|
|
|
volumes:
|
|
sdp-data:
|