Files
gridpilot.gg/docker-compose.test.yml
2026-01-03 02:42:47 +01:00

55 lines
1.6 KiB
YAML

services:
# Ready check - simple service that verifies dependencies are available
ready:
image: node:20-alpine
working_dir: /app
volumes:
- ./:/app
command:
[
"sh",
"-lc",
"set -e; echo '[ready] Checking dependencies...'; if [ -d \"/app/node_modules\" ] && [ -f \"/app/node_modules/.package-lock.json\" ]; then echo '[ready] Dependencies found'; exit 0; else echo '[ready] Dependencies not found - please run: npm install'; exit 1; fi"
]
networks:
- gridpilot-test-network
restart: "no"
# Real API server (not mock)
api:
image: node:20-alpine
working_dir: /app/apps/api
environment:
- NODE_ENV=test
- PORT=3000
- GRIDPILOT_API_PERSISTENCE=inmemory
- ALLOW_DEMO_LOGIN=true
- GRIDPILOT_FEATURES_JSON={"sponsors.portal":"enabled","admin.dashboard":"enabled"}
ports:
- "3101:3000"
volumes:
- ./:/app
- /Users/marcmintel/Projects/gridpilot/node_modules:/app/node_modules:ro
command: ["sh", "-lc", "echo '[api] Starting real API...'; npm run start:dev"]
depends_on:
ready:
condition: service_completed_successfully
networks:
- gridpilot-test-network
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://localhost:3000/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
]
interval: 2s
timeout: 2s
retries: 30
start_period: 10s
networks:
gridpilot-test-network:
driver: bridge