-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathcompose.yaml
88 lines (82 loc) · 1.88 KB
/
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
81
82
83
84
85
86
87
88
version: "3.9"
services:
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
api01:
condition:
service_healthy
api02:
condition:
service_healthy
ports:
- "9999:9999"
healthcheck:
test: service nginx status || exit 1
timeout: 10s
deploy:
resources:
limits:
cpus: "0.1"
memory: "30MB"
rinha-db:
image: postgres:latest
container_name: rinha-db
user: postgres
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=rinha
ports:
- "5432:5432"
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./postgres.conf:/etc/postgres/postgres.conf
- rinha-db:/data/postgres
command: postgres -c checkpoint_timeout=600 -c max_wal_size=2096 -c synchronous_commit=0 -c full_page_writes=0 -c fsync=off -c check_function_bodies=false
healthcheck:
test: [ 'CMD', 'pg_isready' ]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.4"
memory: "100MB"
api01: &api
image: gianimpronta/rdb-2024-q1-spring-boot:native
hostname: api01
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=rinha
ports:
- "8081:8080"
depends_on:
rinha-db:
condition:
service_healthy
healthcheck:
test: [ 'CMD-SHELL', 'curl -so /dev/null http://localhost:8080/clientes/1/extrato || exit 1' ]
interval: 5s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.5"
memory: "210MB"
api02:
<<: *api
hostname: api02
ports:
- "8082:8080"
networks:
default:
name: rinha-nginx-2024q1
driver: bridge
volumes:
rinha-db: