forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
52 lines (49 loc) · 1.29 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
version: "3.5"
name: "rinha-backend-2024-q1-felipma"
services:
database:
image: postgres:16-alpine
environment:
POSTGRES_USER: dbuser
POSTGRES_PASSWORD: dbpassword
POSTGRES_DB: dbname
deploy:
resources:
limits:
cpus: "0.7"
memory: "170MB"
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
network_mode: "host"
command: -c fsync=off -c full_page_writes=off -c checkpoint_timeout=360 -c synchronous_commit=off -c max_connections=60 -c shared_buffers=96MB -c wal_level=minimal -c max_wal_senders=0
api01: &api
image: felipma/rinha-backend-2024-q1-felipma-rataria-version:latest
depends_on:
- database
environment:
DATABASE_URL: "postgres://dbuser:dbpassword@localhost:5432/dbname"
PORT: 8081
deploy:
resources:
limits:
cpus: "0.3"
memory: "150MB"
network_mode: "host"
api02:
<<: *api
environment:
DATABASE_URL: "postgres://dbuser:dbpassword@localhost:5432/dbname"
PORT: 8082
nginx:
image: nginx:alpine
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
deploy:
resources:
limits:
cpus: "0.2"
memory: "80MB"
network_mode: "host"