-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yaml
80 lines (71 loc) · 1.59 KB
/
docker-compose.yaml
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
version: "3.8"
services:
## limites
## cpus 1.5
## memory 550MB
api-01: &api
image: jp0user0docker/rinha_q1_2024:latest
container_name: api-01
hostname: api-01
environment:
DB_CONNECTION_STRING: postgres://user:password@postgres:5432/rinha_db?sslmode=disable
MAX_CONN: 20
MIN_CONN: 5
ports:
- "8080:3001"
depends_on:
- postgres
restart: on-failure
deploy:
resources:
limits:
cpus: "0.3"
memory: "70MB"
api-02:
<<: *api
container_name: api-02
hostname: api-02
ports:
- "8081:3001"
nginx:
container_name: nginx
hostname: nginx
image: nginx:1.25.4-alpine
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
api-01:
condition: service_started
api-02:
condition: service_started
restart: on-failure
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.3"
memory: "50MB"
# database
postgres:
image: postgres:16-alpine
container_name: postgres
environment:
POSTGRES_PASSWORD: password
POSTGRES_USER: user
POSTGRES_DB: rinha_db
ports:
- 5432:5432
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
- ./postgresql.conf:/docker-entrypoint-initdb.d/postgresql.conf
command: postgres -c config_file=/docker-entrypoint-initdb.d/postgresql.conf
deploy:
resources:
limits:
cpus: "0.5"
memory: "360MB"
networks:
default:
driver: bridge
name: network-rinha