-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
72 lines (67 loc) · 1.62 KB
/
docker-compose.test.yml
File metadata and controls
72 lines (67 loc) · 1.62 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
version: '3.8'
services:
# Test database
postgres-test:
image: postgres:15
environment:
POSTGRES_DB: test_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- postgres_test_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# Redis for testing (if needed for caching/sessions)
redis-test:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# Mock API backend for testing
api-test:
build:
context: ./apps/api
dockerfile: Dockerfile.test
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgresql://postgres:postgres@postgres-test:5432/test_db
- REDIS_URL=redis://redis-test:6379
- ENVIRONMENT=test
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- AWS_DEFAULT_REGION=us-east-1
depends_on:
postgres-test:
condition: service_healthy
redis-test:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 10s
timeout: 5s
retries: 5
# Frontend for testing
web-test:
build:
context: ./apps/web
dockerfile: Dockerfile.test
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=http://api-test:8000
- NODE_ENV=test
depends_on:
api-test:
condition: service_healthy
volumes:
postgres_test_data: