forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
67 lines (62 loc) · 1.58 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
version: "3.8"
services:
api1: &api
image: ghcr.io/adamatti/rinha-de-backend-2024-q1:node
depends_on:
- db
environment:
- DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- DATABASE_MAX=40
- PORT=8080
ports:
- 8080:8080
deploy:
resources:
limits:
cpus: "0.6"
memory: "225MB"
api2:
<<: *api
environment:
- DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
- DATABASE_MAX=40
- PORT=8081
ports:
- 8081:8081
nginx:
image: nginx:1.25.4
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "9999:9999"
depends_on:
- api1
- api2
deploy:
resources:
limits:
cpus: "0.1"
memory: "50MB"
db:
image: postgres:latest
hostname: db
command: postgres -c checkpoint_timeout=600 -c max_wal_size=4096 -c synchronous_commit=0 -c fsync=0 -c full_page_writes=0 -c log_min_messages=panic -c log_min_error_statement=panic -c log_min_duration_statement=-1 -c log_min_duration_sample=-1
ports:
- "5432:5432"
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./seed.sql:/docker-entrypoint-initdb.d/seed.sql
# - ./postgresql.conf:/docker-entrypoint-initdb.d/postgresql.conf
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
deploy:
resources:
limits:
cpus: "0.2"
memory: "50MB"
networks:
default:
driver: bridge
name: rinha-backend-y24q1