This repository was archived by the owner on Feb 27, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
113 lines (93 loc) · 3.37 KB
/
Makefile
File metadata and controls
113 lines (93 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
.PHONY: help install dev build start clean reset docker-build docker-up docker-down logs sandbox-build
# Default target
help:
@echo "Cloud Sandbox - Development Commands"
@echo ""
@echo "Setup:"
@echo " make install Install all dependencies"
@echo " make sandbox-build Build the sandbox Docker image"
@echo ""
@echo "Development:"
@echo " make dev Start development servers (orchestrator + frontend)"
@echo " make dev-orch Start orchestrator only"
@echo " make dev-front Start frontend only"
@echo ""
@echo "Production:"
@echo " make build Build all packages"
@echo " make start Start production server"
@echo ""
@echo "Docker:"
@echo " make docker-build Build Docker image"
@echo " make docker-up Start with docker-compose"
@echo " make docker-down Stop docker-compose"
@echo " make logs View docker logs"
@echo ""
@echo "Cleanup:"
@echo " make clean Remove build artifacts"
@echo " make clean-containers Stop and remove all sandbox containers"
@echo " make reset Stop all containers and clear everything for fresh start"
# =============================================================================
# Setup
# =============================================================================
install:
npm install
npx playwright install chromium
sandbox-build:
@echo "Building sandbox Docker image..."
docker build -t cloud-sandbox-env:latest packages/sandbox/
@echo "Sandbox image built successfully!"
# =============================================================================
# Development
# =============================================================================
dev: sandbox-build
@echo "Starting development servers..."
@echo "Orchestrator: http://localhost:8000"
@echo "Frontend: http://localhost:5173"
@echo ""
@echo "NOTE: Each sandbox runs in an isolated Docker container"
@echo ""
npm run dev
dev-orch: sandbox-build
cd packages/orchestrator && npm run dev
dev-front:
cd packages/frontend && npm run dev
# =============================================================================
# Production
# =============================================================================
build: sandbox-build
npm run build
start: build
cd packages/orchestrator && npm start
# =============================================================================
# Docker
# =============================================================================
docker-build: sandbox-build
docker build -t cloud-sandbox:latest .
docker-up:
docker-compose up -d
docker-down:
docker-compose down
logs:
docker-compose logs -f
# =============================================================================
# Cleanup
# =============================================================================
clean:
rm -rf node_modules
rm -rf packages/*/node_modules
rm -rf packages/*/dist
rm -rf packages/frontend/build
rm -rf data
clean-containers:
@echo "Stopping and removing all sandbox containers..."
-docker ps -a --filter "name=sandbox-" --format "{{.ID}}" | xargs -r docker rm -f
@echo "Done!"
reset: clean-containers
@echo "Resetting cloud sandbox environment..."
@echo "Killing any running dev servers..."
-pkill -f "tsx watch" 2>/dev/null || true
-pkill -f "vite" 2>/dev/null || true
@echo "Clearing data directory..."
rm -rf data
@echo ""
@echo "Reset complete! Run 'make dev' to start fresh."