-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathdocker-compose.benchmark.yml
More file actions
124 lines (118 loc) · 2.69 KB
/
docker-compose.benchmark.yml
File metadata and controls
124 lines (118 loc) · 2.69 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
117
118
119
120
121
122
123
124
services:
db:
image: postgres:15-alpine
environment:
POSTGRES_USER: healthcare_user
POSTGRES_PASSWORD: healthcare_pass
POSTGRES_DB: healthcare_db
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- healthcare-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U healthcare_user -d healthcare_db"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.50"
memory: 512M
redis:
image: redis:7-alpine
networks:
- healthcare-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.25"
memory: 256M
rabbitmq:
image: rabbitmq:3-management
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- "5672:5672"
- "15672:15672"
networks:
- healthcare-network
restart: unless-stopped
deploy:
resources:
limits:
cpus: "0.25"
memory: 256M
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql://healthcare_user:healthcare_pass@db:5432/healthcare_db
REDIS_URL: redis://redis:6379/0
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/
SECRET_KEY: benchmark-jwt-secret-key
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_started
networks:
- healthcare-network
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
deploy:
resources:
limits:
cpus: "0.50"
memory: 512M
reservations:
cpus: "0.25"
memory: 256M
notification:
build:
context: .
dockerfile: Dockerfile.notification
environment:
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/
SMTP_SERVER: smtp.example.com
SMTP_PORT: "587"
SMTP_USERNAME: dummy@example.com
SMTP_PASSWORD: dummypassword
EMAIL_FROM: noreply@healthcare-benchmark.local
depends_on:
rabbitmq:
condition: service_started
networks:
- healthcare-network
restart: unless-stopped
deploy:
resources:
limits:
cpus: "0.25"
memory: 256M
volumes:
postgres_data:
networks:
healthcare-network:
driver: bridge