-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
116 lines (111 loc) · 3.21 KB
/
docker-compose.test.yml
File metadata and controls
116 lines (111 loc) · 3.21 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
services:
postgres-test:
image: timescale/timescaledb:latest-pg16
container_name: logtide-postgres-test
environment:
POSTGRES_DB: logtide_test
POSTGRES_USER: logtide_test
POSTGRES_PASSWORD: test_password
ports:
- "5433:5432"
tmpfs:
- /var/lib/postgresql/data # In-memory for speed
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U logtide_test" ]
interval: 5s
timeout: 3s
retries: 5
networks:
- logtide-test-network
redis-test:
image: redis:7-alpine
container_name: logtide-redis-test
command: redis-server --requirepass test_password
ports:
- "6380:6379"
healthcheck:
test: [ "CMD", "redis-cli", "-a", "test_password", "ping" ]
interval: 5s
timeout: 3s
retries: 5
networks:
- logtide-test-network
mailhog-test:
image: mailhog/mailhog:latest
container_name: logtide-mailhog-test
ports:
- "1025:1025" # SMTP
- "8025:8025" # API/UI
networks:
- logtide-test-network
# Frontend for E2E testing
frontend-test:
build:
context: .
dockerfile: packages/frontend/Dockerfile
args:
PUBLIC_API_URL: http://localhost:3001
container_name: logtide-frontend-test
environment:
NODE_ENV: production
PORT: 3000
HOST: 0.0.0.0
PUBLIC_API_URL: http://localhost:3001
ORIGIN: http://localhost:3002
ports:
- "3002:3000"
depends_on:
backend-test:
condition: service_healthy
healthcheck:
test: [ "CMD", "node", "-e", "require('http').get('http://localhost:3000/', (r) => r.statusCode === 200 ? process.exit(0) : process.exit(1))" ]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
networks:
- logtide-test-network
# Backend for E2E and load testing
backend-test:
build:
context: .
dockerfile: packages/backend/Dockerfile
container_name: logtide-backend-test
environment:
NODE_ENV: test
PORT: 8080
DATABASE_URL: postgresql://logtide_test:test_password@postgres-test:5432/logtide_test
DATABASE_HOST: postgres-test
DB_USER: logtide_test
REDIS_URL: redis://:test_password@redis-test:6379
API_KEY_SECRET: test_secret_key_32_chars_long!!!
SMTP_HOST: mailhog-test
SMTP_PORT: 1025
SMTP_USER: test
SMTP_PASS: test
SMTP_FROM: test@logtide.dev
# Higher rate limits for load testing (100 req/s = 6000/min, use 100000 for safety)
RATE_LIMIT_MAX: 100000
RATE_LIMIT_WINDOW: 60000
# Higher auth rate limits for E2E testing (many user registrations)
AUTH_RATE_LIMIT_REGISTER: 10000
AUTH_RATE_LIMIT_LOGIN: 10000
AUTH_RATE_LIMIT_WINDOW: 60000
ports:
- "3001:8080"
depends_on:
postgres-test:
condition: service_healthy
redis-test:
condition: service_healthy
healthcheck:
test: [ "CMD", "node", "-e", "require('http').get('http://localhost:8080/health', (r) => r.statusCode === 200 ? process.exit(0) : process.exit(1))" ]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
networks:
- logtide-test-network
networks:
logtide-test-network:
driver: bridge