Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·64 lines (62 loc) · 2.69 KB
/
Copy pathdocker-compose.yml
File metadata and controls
executable file
·64 lines (62 loc) · 2.69 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
services:
# ── VS Code Web + AI Tools ──────────────────────────────────────────
sandbox:
build: .
container_name: dev-sandbox
depends_on:
dind:
condition: service_started
ports:
- "${SANDBOX_PORT:-8080}:8080"
volumes:
- "./workspace:/workspace"
- "./home:/home/dev"
environment:
- DOCKER_HOST=tcp://dind:2375
- PASSWORD=${PASSWORD:-}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
networks:
- sandbox-net
restart: unless-stopped
# ── Docker-in-Docker daemon ─────────────────────────────────────────
# Runs a fully isolated Docker daemon. Containers you create from the
# sandbox terminal live inside this container.
dind:
image: docker:27-dind
container_name: dev-sandbox-dind
privileged: true
ports:
# The Docker daemon (2375) is intentionally NOT published to the host.
# The sandbox reaches it internally over sandbox-net via
# DOCKER_HOST=tcp://dind:2375. Publishing 2375 would expose an
# unauthenticated, root-equivalent API to your network.
# If you genuinely need host-side Docker CLI access, bind to loopback
# ONLY (still unauthenticated — never bind to 0.0.0.0):
# - "127.0.0.1:${DIND_PORT:-1000}:2375"
#
# Preview port range — when you run docker run -p 3000:3000 myapp
# from the sandbox terminal, the container binds to the DinD
# container's port 3000, which is forwarded here to the host.
# Accessible at http://<host-ip>:3000
# Expand this range in .env if you need more ports.
- "${PREVIEW_START:-2000}-${PREVIEW_END:-2020}:2000-2020"
volumes:
# Shared workspace — same path in both containers so that
# docker build contexts and volume mounts (-v /workspace/...)
# work correctly from the sandbox terminal.
- "./workspace:/workspace"
# Persistent Docker data (images, layers, build cache).
# MUST be a real local filesystem path — on Unraid, a cache pool under
# /mnt/<pool>/... Do NOT point DIND_STORAGE at a FUSE user share
# (/mnt/user/...) or a network mount: overlay2 can't initialize and
# containerd's metadata DB hangs there, crash-looping the daemon.
- "${DIND_STORAGE:-/mnt/ssd_cache_nvme/appdata/dev-sandbox/dind}:/var/lib/docker"
environment:
# Disable TLS — communication is internal on sandbox-net only
- DOCKER_TLS_CERTDIR=
networks:
- sandbox-net
restart: unless-stopped
networks:
sandbox-net: