-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (53 loc) · 1.59 KB
/
Copy pathdocker-compose.yml
File metadata and controls
56 lines (53 loc) · 1.59 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
# Test Infrastructure
#
# Provides services needed for integration tests across the monorepo.
# Uses non-standard ports by default to avoid conflicts with other containers.
#
# Usage:
# docker compose up -d # Start all services
# docker compose up redis -d # Start only Redis
# pnpm test # Run tests (services auto-detected via .env)
# docker compose down # Stop all services
#
# Ports are configurable via .env or environment variables:
# PGPORT=5433 (default) — PostgreSQL
# REDIS_PORT=6380 (default) — Redis
services:
redis:
image: redis:7-alpine
ports:
- '${REDIS_PORT:-6380}:6379'
volumes:
- redis-data:/data
command: redis-server --appendonly yes
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 2s
timeout: 3s
retries: 10
postgres:
image: postgres:17-alpine
ports:
- '${PGPORT:-5433}:5432'
environment:
POSTGRES_USER: justscale
POSTGRES_PASSWORD: justscale
POSTGRES_DB: justscale_test
# Default max_connections is 100. With ~28 e2e tests each opening
# their own postgres-js pool (default max:10), parallel runs starved
# the connection pool and tests hung waiting to acquire. Bump well
# over the working set so tests can actually run concurrently.
command:
- postgres
- -c
- max_connections=500
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U justscale']
interval: 2s
timeout: 3s
retries: 10
volumes:
redis-data:
postgres-data: