-
Notifications
You must be signed in to change notification settings - Fork 925
/
docker-compose.yml
87 lines (82 loc) · 2.39 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
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
version: '3.5'
services:
api01: &api
image: suricat/rinha-2024-q1:latest
restart: always
network_mode: "host"
environment:
PORT: '8080'
DATABASE_SELECTED: mongodb
PREFORK_ENABLED: 'false'
LOG_LEVEL: '2'
DATABASE_HOST: 'localhost'
CACHE_HOST: 'localhost'
PROFILING_ENABLED: 'false'
PROFILING_CPU_FILEPATH: '/app/prof/cpu-1.prof'
PROFILING_MEMORY_FILEPATH: '/app/prof/memory-1.prof'
DATABASE_MONGODB_URI: mongodb://root:root@localhost:27017/rinha2024q1?authSource=admin&readPreference=primary&appname=rinha-go-suricat&directConnection=true&ssl=false
volumes:
- ./prof:/app/prof
depends_on:
- db_mongo
- redis
deploy:
resources:
limits:
cpus: '0.05'
memory: '85MB'
api02:
<<: *api
environment:
PORT: '8081'
DATABASE_SELECTED: mongodb
PREFORK_ENABLED: 'false'
LOG_LEVEL: '2'
DATABASE_HOST: 'localhost'
CACHE_HOST: 'localhost'
PROFILING_ENABLED: 'false'
PROFILING_CPU_FILEPATH: '/app/prof/cpu-2.prof'
PROFILING_MEMORY_FILEPATH: '/app/prof/memory-2.prof'
DATABASE_MONGODB_URI: mongodb://root:root@localhost:27017/rinha2024q1?authSource=admin&readPreference=primary&appname=rinha-go-suricat&directConnection=true&ssl=false
nginx: # Load Balancer
image: nginx:latest
network_mode: "host"
volumes:
- ./conf/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
deploy:
resources:
limits:
cpus: '0.05'
memory: '30MB'
db_mongo:
image: mongodb/mongodb-community-server:latest
hostname: db
network_mode: host
environment:
MONGODB_INITDB_ROOT_USERNAME: root
MONGODB_INITDB_ROOT_PASSWORD: root
MONGODB_INITDB_DATABASE: rinha2024q1
volumes:
- ./conf/mongod.conf:/etc/mongo/mongod.conf
- ./conf/init-mongodb.js:/docker-entrypoint-initdb.d/init-mongodb.js
command: "--config /etc/mongo/mongod.conf"
deploy:
resources:
limits:
cpus: '1.3'
memory: '330MB'
redis:
image: redis
hostname: redis
network_mode: host
command: redis-server /etc/redis/redis.conf --save "" --appendonly no --maxclients 20000
volumes:
- ./conf/redis.conf:/etc/redis/redis.conf
deploy:
resources:
limits:
cpus: '0.05'
memory: '20MB'