-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
72 lines (66 loc) · 1.63 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
version: '3'
services:
rinha-api-01: &api
image: italopussi/rinha-de-backend-2024-q1-python:latest
hostname: rinha-api-01
container_name: rinha-api-01
restart: on-failure
network_mode: host
environment:
- API_PORT=${API_PORT_1}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_DATABASE=${DB_DATABASE}
- DB_PORT=${DB_PORT}
- DB_HOST=${DB_HOST}
depends_on:
- rinha-db
deploy:
resources:
limits:
cpus: "0.3"
memory: "50MB"
rinha-api-02:
<<: *api
hostname: rinha-api-02
container_name: rinha-api-02
environment:
- API_PORT=${API_PORT_2}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_DATABASE=${DB_DATABASE}
- DB_PORT=${DB_PORT}
- DB_HOST=${DB_HOST}
depends_on:
- rinha-db
rinha-db:
image: postgres:16.1
container_name: rinha-db
network_mode: host
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_DATABASE}
- PGPORT=${DB_PORT}
volumes:
- ./infra/init.sql:/docker-entrypoint-initdb.d/init.sql
command: postgres -c checkpoint_timeout=600 -c max_wal_size=4096 -c synchronous_commit=0
deploy:
resources:
limits:
cpus: "0.6"
memory: "50MB"
nginx:
image: nginx:latest
container_name: nginx-rinha-2024
network_mode: host
volumes:
- ./infra/nginx.conf:/etc/nginx/nginx.conf
depends_on:
- rinha-api-01
- rinha-api-02
deploy:
resources:
limits:
cpus: "0.2"
memory: "50MB"