forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
63 lines (63 loc) · 1.57 KB
/
docker-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
version: '3.7'
services:
rinhadb:
image: postgres:16.2-alpine3.19
container_name: rinhadb
platform: linux/amd64
environment:
POSTGRES_USER: rinha
POSTGRES_PASSWORD: rinha
POSTGRES_DB: rinha
command: postgres -c max_connections=200 -c shared_buffers=256MB -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c log_min_messages=PANIC -c autovacuum=off
volumes:
- ./script.sql:/docker-entrypoint-initdb.d/script.sql
networks:
- rinha-de-backend-2024-q1-node
deploy:
resources:
limits:
cpus: '0.6'
memory: '300MB'
api01: &api
image: dionesvfreitas/rinha-de-backend-2024-q1-node
container_name: api01
env_file:
- .env
depends_on:
- rinhadb
networks:
- rinha-de-backend-2024-q1-node
deploy:
resources:
limits:
cpus: '0.3'
memory: '100MB'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health-check"]
api02:
<<: *api
container_name: api02
loadbalancer:
image: nginx:alpine
platform: linux/amd64
container_name: loadbalancer
ports:
- '9999:9999'
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
api01:
condition: service_healthy
api02:
condition: service_healthy
networks:
- rinha-de-backend-2024-q1-node
deploy:
resources:
limits:
cpus: '0.3'
memory: '50MB'
networks:
rinha-de-backend-2024-q1-node:
driver: bridge
name: rinha-de-backend-2024-q1-node