-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
81 lines (76 loc) · 1.92 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
version: "3.5"
services:
api01: &api
image: vitorsalgado/rinha-2024q1-api
pull_policy: always
container_name: api01
hostname: api01
network_mode: host
environment:
- DB_CONN_STRING=user=rinha password=rinha dbname=rinha host=0.0.0.0 port=5432 sslmode=disable pool_min_conns=5 pool_max_conns=5
- ADDR=:8081
- GOGC=off
- GOMEMLIMIT=120MiB
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.2"
memory: "125MB"
api02:
<<: *api
container_name: api02
hostname: api02
network_mode: host
environment:
- DB_CONN_STRING=user=rinha password=rinha dbname=rinha host=0.0.0.0 port=5432 sslmode=disable pool_min_conns=5 pool_max_conns=5
- ADDR=:8082
- GOGC=off
- GOMEMLIMIT=120MiB
envoy:
image: envoyproxy/envoy:v1.29-latest
container_name: envoy
network_mode: host
expose:
- "9999"
volumes:
- ./conf/envoy.yaml:/etc/envoy/envoy.yaml:ro
command: /usr/local/bin/envoy -c /etc/envoy/envoy.yaml --concurrency 1
depends_on:
- api01
- api02
deploy:
resources:
limits:
cpus: "0.3"
memory: "100MB"
db:
image: postgres:16.2
container_name: db
environment:
- POSTGRES_PASSWORD=rinha
- POSTGRES_USER=rinha
- POSTGRES_DB=rinha
network_mode: host
expose:
- "5432"
volumes:
- ./conf/script.sql:/docker-entrypoint-initdb.d/script.sql
- ./conf/postgresql.conf:/etc/postgresql/postgresql.conf
- data:/var/lib/postgresql/data
command: postgres -c config_file=/etc/postgresql/postgresql.conf
healthcheck:
test: ["CMD", "pg_isready", "--username", "rinha"]
interval: 5s
timeout: 5s
retries: 15
start_period: 10s
deploy:
resources:
limits:
cpus: "0.8"
memory: "200MB"
volumes:
data: