-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
52 lines (52 loc) · 1.13 KB
/
docker-compose.yml
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
version: "3.9"
services:
mongo:
image: mongo
environment:
MONGO_INITDB_DATABASE: "rinha"
volumes:
- ./conf/seed.js:/docker-entrypoint-initdb.d/seed.js:ro
- ./conf/mongod.conf:/etc/mongod.conf:ro
ports:
- "27017:27017"
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh mongo:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
command: [ "--config", "/etc/mongod.conf" ]
deploy:
resources:
limits:
cpus: "0.8"
memory: "350MB"
api1: &api1
hostname: api1
image: rafaelpadovezi/rinha-2-mongo:1.1
depends_on:
mongo:
condition: service_healthy
environment:
ConnectionStrings__MongoDb: "mongodb://mongo:27017"
deploy:
resources:
limits:
cpus: "0.27"
memory: "90MB"
api2:
<<: *api1
hostname: api2
nginx:
image: nginx
volumes:
- ./conf/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.16"
memory: "20MB"