Files
remoteturtle/docker-compose.yml
MayaTheShy 0a66cad13a fix(docker): clone platform from git instead of additional_contexts
The additional_contexts approach required cc-platform-core to exist on
the Docker host at a relative path. This fails on servers where the
repo layout differs. Instead, use a multi-stage build: stage 1 clones
cc-platform-core from Gitea (depth 1), stage 2 copies server/ into the
app and rewrites the file: path. Fully self-contained — no host deps.
Applied to both production and dev Dockerfiles.
2026-03-28 22:38:07 -04:00

47 lines
1.1 KiB
YAML

services:
# Backend server
server:
build:
context: ./server
dockerfile: Dockerfile
container_name: turtle-server
ports:
- "4200:3001" # HTTP API + WebSocket (unified)
environment:
- NODE_ENV=production
- PORT=3001
- INVENTORY_SERVER_URL=${INVENTORY_SERVER_URL:-}
- API_KEY=${API_KEY:-}
restart: unless-stopped
networks:
- turtle-network
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/api/turtles', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
# Frontend client
client:
build:
context: ./client
dockerfile: Dockerfile
container_name: turtle-client
ports:
- "4444:3000" # Vite preview server
depends_on:
- server
restart: unless-stopped
networks:
- turtle-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000"]
interval: 30s
timeout: 3s
retries: 3
networks:
turtle-network:
driver: bridge