forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
68 lines (64 loc) · 1.87 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
version: "3.7"
services:
api01: &api
hostname: api01
image: erickmarx/rinha-2024-q1-bun:latest
environment:
- PORT=8081
restart: "on-failure"
extra_hosts:
- "host.docker.internal:host-gateway"
network_mode: "host"
stdin_open: false
pull_policy: always
depends_on:
postgres:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.45"
memory: "200MB"
api02:
<<: *api
hostname: api02
environment:
- PORT=8082
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
extra_hosts:
- host.docker.internal:host-gateway
depends_on:
- api01
- api02
network_mode: "host"
deploy:
resources:
limits:
cpus: "0.2"
memory: "30MB"
postgres:
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=123
- POSTGRES_DB=rinha
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/2_init.sql
extra_hosts:
- host.docker.internal:host-gateway
network_mode: "host"
command: postgres -c checkpoint_timeout=600 -c max_wal_size=4096 -N 50 -c shared_buffers=256MB -c max_connections=360 -c unix_socket_directories='/var/run/postgresql' -c work_mem=32MB -c maintenance_work_mem=256MB -c effective_cache_size=55MB -c wal_buffers=64MB -c checkpoint_completion_target=0.9 -c random_page_cost=4.0 -c effective_io_concurrency=2 -c autovacuum=on -c log_statement='none' -c log_duration=off -c log_lock_waits=on -c log_error_verbosity=terse -c log_min_messages=fatal -c log_min_error_statement=fatal
deploy:
resources:
limits:
cpus: "0.4"
memory: "120MB"
healthcheck:
test: ["CMD-SHELL", "pg_isready -d rinha -U postgres"]
interval: 10s
timeout: 5s
retries: 5