-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
81 lines (76 loc) · 2.29 KB
/
docker-compose.dev.yml
File metadata and controls
81 lines (76 loc) · 2.29 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
# Docker Compose for local development and E2E tests
# Provides PostgreSQL 16 + DB initialization (migrations + seed)
# Usage: docker compose -f docker-compose.dev.yml up -d
services:
postgres:
image: postgres:16-alpine
container_name: squash-bot-postgres-test
environment:
- POSTGRES_DB=squash_bot_test
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=test
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d squash_bot_test"]
interval: 5s
timeout: 3s
retries: 5
db-init:
image: node:22-alpine
container_name: squash-bot-db-init
working_dir: /app
volumes:
- .:/app
- db_init_node_modules:/app/node_modules
environment:
- DATABASE_URL=postgresql://postgres:test@postgres:5432/squash_bot_test
- ENVIRONMENT=test
depends_on:
postgres:
condition: service_healthy
command: sh -c "npm ci --ignore-scripts && npx tsx src/storage/db/migrate.ts && npx tsx src/storage/db/override-test-settings.ts"
restart: "no"
bot:
image: node:22-alpine
container_name: squash-bot-app-test
working_dir: /app
volumes:
- .:/app
- bot_node_modules:/app/node_modules
env_file:
- .env.test
environment:
- DATABASE_URL=postgresql://postgres:test@postgres:5432/squash_bot_test
- ENVIRONMENT=test
- NOTIFICATIONS_REMINDER_THRESHOLD_HOURS=0.01
depends_on:
db-init:
condition: service_completed_successfully
ports:
- "3010:3010"
command: sh -c "npm ci --ignore-scripts && npx nodemon --legacy-watch --watch src --ext ts --exec 'npx tsx src/index.ts'"
healthcheck:
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:3010/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1); }).on('error', () => process.exit(1));\""]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
scheduler:
build: ./scheduler
container_name: squash-bot-scheduler-test
env_file:
- .env.test
environment:
- BOT_URL=http://bot:3010
depends_on:
bot:
condition: service_healthy
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
db_init_node_modules:
bot_node_modules: