clean routes
This commit is contained in:
@@ -1,37 +1,39 @@
|
||||
services:
|
||||
deps:
|
||||
# Ready check - simple service that verifies dependencies are available
|
||||
ready:
|
||||
image: node:20-alpine
|
||||
working_dir: /app
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- NPM_CONFIG_FUND=false
|
||||
- NPM_CONFIG_AUDIT=false
|
||||
- NPM_CONFIG_UPDATE_NOTIFIER=false
|
||||
volumes:
|
||||
- ./:/app
|
||||
- test_node_modules:/app/node_modules
|
||||
- test_npm_cache:/root/.npm
|
||||
command:
|
||||
[
|
||||
"sh",
|
||||
"-lc",
|
||||
"set -e; LOCK_HASH=\"$$(sha1sum package-lock.json | awk '{print $$1}')\"; MARKER=\"node_modules/.gridpilot_lock_hash_test\"; if [ -f \"$$MARKER\" ] && [ \"$$(cat \"$$MARKER\")\" = \"$$LOCK_HASH\" ]; then echo \"[deps] node_modules up-to-date\"; else echo \"[deps] installing workspace deps\"; rm -rf apps/api/node_modules apps/website/node_modules apps/companion/node_modules; npm install --no-package-lock --include-workspace-root --no-audit --fund=false --prefer-offline; echo \"$$LOCK_HASH\" > \"$$MARKER\"; fi",
|
||||
"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
|
||||
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
|
||||
command: ["sh", "-lc", "node testing/mock-api-server.cjs"]
|
||||
- /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
|
||||
@@ -46,44 +48,8 @@ services:
|
||||
interval: 2s
|
||||
timeout: 2s
|
||||
retries: 30
|
||||
|
||||
website:
|
||||
image: gridpilot-website-test
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/website/Dockerfile.dev
|
||||
environment:
|
||||
- NEXT_TELEMETRY_DISABLED=1
|
||||
- NODE_ENV=development
|
||||
- DOCKER=true
|
||||
- DOCKER_SMOKE=true
|
||||
- NEXT_PUBLIC_GRIDPILOT_MODE=alpha
|
||||
- API_BASE_URL=http://api:3000
|
||||
- NEXT_PUBLIC_API_BASE_URL=http://localhost:3101
|
||||
ports:
|
||||
- "3100:3000"
|
||||
volumes:
|
||||
- ./:/app
|
||||
- test_node_modules:/app/node_modules
|
||||
- test_npm_cache:/root/.npm
|
||||
command: ["sh", "-lc", "npm run dev --workspace=@gridpilot/website"]
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- gridpilot-test-network
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test:
|
||||
["CMD", "node", "-e", "fetch('http://localhost:3000').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
start_period: 10s
|
||||
|
||||
networks:
|
||||
gridpilot-test-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
test_node_modules:
|
||||
test_npm_cache:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user