-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
86 lines (84 loc) · 2.3 KB
/
docker-compose.test.yml
File metadata and controls
86 lines (84 loc) · 2.3 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
# Fast test environment
#
# Usage:
# make test # Playwright UI with hot reload (frontend via Vite)
# make test-run # CI mode headless (frontend via Vite)
# make test-e2e # CI mode with all containers (frontend built)
services:
frontend-test:
image: mainloop-frontend-test
build:
context: .
dockerfile: frontend/Dockerfile
args:
- VITE_API_URL=http://localhost:8081
container_name: mainloop-frontend-test
ports:
- 3031:3000
environment:
- NODE_ENV=production
depends_on:
backend-test:
condition: service_healthy
healthcheck:
test:
[
CMD,
node,
-e,
"require('http').get('http://localhost:3000', (r) => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))"
]
interval: 3s
timeout: 5s
retries: 10
start_period: 10s
profiles:
- ci
postgres-test:
image: postgres:16-alpine
container_name: mainloop-postgres-test
environment:
POSTGRES_USER: mainloop
POSTGRES_PASSWORD: mainloop
POSTGRES_DB: mainloop
ports:
- 5433:5432
healthcheck:
test: [CMD-SHELL, pg_isready -U mainloop]
interval: 2s
timeout: 5s
retries: 10
backend-test:
image: mainloop-backend-test
build:
context: .
dockerfile: backend/Dockerfile
container_name: mainloop-backend-test
ports:
- 8081:8000
volumes:
# Mount source for hot reload (no rebuild needed)
- ./backend/src:/app/src:ro
- ./models:/models:ro
environment:
- PYTHONUNBUFFERED=1
- DB_HOST=postgres-test
- DB_PORT=5432
- DB_NAME=mainloop
- DB_USER=mainloop
- DB_PASSWORD=mainloop
- CLAUDE_AGENT_URL=http://claude-agent-test:8001
- IS_TEST_ENV=true
- USE_MOCK_GITHUB=${USE_MOCK_GITHUB:-true}
- CLAUDE_CODE_OAUTH_TOKEN=${CLAUDE_CODE_OAUTH_TOKEN:-}
# No --reload needed - watchexec restarts container on file changes
command: [uvicorn, mainloop.api:app, --host, 0.0.0.0, --port, '8000']
depends_on:
postgres-test:
condition: service_healthy
healthcheck:
test: [CMD, curl, -f, http://localhost:8000/health]
interval: 3s
timeout: 5s
retries: 10
start_period: 10s