-
Notifications
You must be signed in to change notification settings - Fork 925
/
docker-compose.yml
74 lines (70 loc) · 1.66 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
version: '3.8'
services:
nginx:
image: nginx
hostname: rinha-nginx
container_name: rinha-nginx
network_mode: host
ports:
- "9999:9999"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
- api1
- api2
deploy:
resources:
limits:
cpus: "0.30"
memory: "137MB"
api1: &api
image: brunocamarggo/rinha2024q1-golang:0.0.10
container_name: rinha2024q1-api-1
hostname: rinha2024q1-api-1
network_mode: host
environment:
DB_HOST: "127.0.0.1"
HTTP_PORT: 8081
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.30"
memory: "32MB"
ports:
- "8081:8081"
api2:
<<: *api
container_name: rinha2024q1-api-2
hostname: rinha2024q1-api-2
environment:
HTTP_PORT: 8082
ports:
- "8082:8082"
db:
image: postgres:16
hostname: rinha-db
container_name: rinha-db
network_mode: host
environment:
POSTGRES_DB: rinha
POSTGRES_USER: rinha
POSTGRES_PASSWORD: rinha123
volumes:
- ./script.sql:/docker-entrypoint-initdb.d/script.sql
- ./postgresql.conf:/etc/postgresql/postgresql.conf
command: postgres -c config_file=/etc/postgresql/postgresql.conf
ports:
- "5432:5432"
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "rinha", "-U", "rinha", "-h", "localhost" ]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.60"
memory: "349MB"