-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
73 lines (68 loc) · 1.73 KB
/
docker-compose.test.yml
File metadata and controls
73 lines (68 loc) · 1.73 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
version: "3.8"
services:
test-db:
image: postgres:15-alpine
environment:
POSTGRES_DB: test_progchain
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
ports:
- "5433:5432"
tmpfs:
- /var/lib/postgresql/data # Use tmpfs for faster tests
healthcheck:
test: ["CMD-SHELL", "pg_isready -U test_user -d test_progchain"]
interval: 5s
timeout: 5s
retries: 5
networks:
- test-network
test-redis:
image: redis:7-alpine
ports:
- "6380:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
networks:
- test-network
test-server:
build:
context: ./server
dockerfile: Dockerfile.dev
volumes:
- ./server:/app
environment:
- DATABASE_URL=postgresql+asyncpg://test_user:test_password@test-db:5432/test_progchain
- REDIS_URL=redis://test-redis:6379/0
- PYTHONPATH=/app/src
- TESTING=true
- OPENAI_API_KEY=${OPENAI_API_KEY:-test-key}
depends_on:
test-db:
condition: service_healthy
test-redis:
condition: service_healthy
networks:
- test-network
command: poetry run pytest /app/tests -v --cov=src --cov-report=html --cov-report=term-missing
test-client:
build:
context: ./client
dockerfile: Dockerfile.dev
volumes:
- ./client:/app
- /app/node_modules
environment:
- NODE_ENV=test
- VITE_API_URL=http://test-server:8000
depends_on:
- test-server
networks:
- test-network
command: npm run test:coverage
networks:
test-network:
driver: bridge