-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
65 lines (61 loc) · 1.56 KB
/
docker-compose.test.yml
File metadata and controls
65 lines (61 loc) · 1.56 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
services:
# PostgreSQL Database
postgres:
image: postgres:15
container_name: cmp-postgres-test
environment:
POSTGRES_DB: cmp
POSTGRES_USER: cmp_user
POSTGRES_PASSWORD: cmp_password
POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256 --auth-local=scram-sha-256"
volumes:
- postgres_test_data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- cmp-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U cmp_user -d cmp"]
interval: 10s
timeout: 5s
retries: 5
# Redis Cache
redis:
image: redis:7-alpine
container_name: cmp-redis-test
command: redis-server --requirepass redis_password
volumes:
- redis_test_data:/data
ports:
- "6379:6379"
networks:
- cmp-network
healthcheck:
test: ["CMD", "redis-cli", "--no-auth-warning", "-a", "redis_password", "ping"]
interval: 10s
timeout: 5s
retries: 5
# NATS Message Broker
nats:
image: nats:2.10-alpine
container_name: cmp-nats-test
command: ["--port", "4222", "--http_port", "8222", "--jetstream", "--cluster_name", "cmp-cluster"]
volumes:
- nats_test_data:/data
ports:
- "4222:4222"
- "8222:8222" # Monitoring
networks:
- cmp-network
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8222/healthz || exit 1"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_test_data:
redis_test_data:
nats_test_data:
networks:
cmp-network:
driver: bridge