-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yaml
94 lines (87 loc) · 2.01 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
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
89
90
91
92
93
94
version: '3.8'
services:
nginx:
image: nginx:1.25.3-alpine3.18
container_name: rinha_nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
ports:
# Obrigatório expor/usar a porta 9999 no load balancer!
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.2"
memory: 90MB
api1: &api
image: victormacedo996/rinha-backend-q1-2024:latest
container_name: rinha_api-01
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: postgres
POSTGRES_MIN_CONNS: 2
POSTGRES_MAX_CONNS: 5
REDIS_URL: redis:6379
API_ID: 1
deploy:
resources:
limits:
cpus: "0.3"
memory: 100MB
api2:
<<: *api
container_name: rinha_api-02
environment:
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: postgres
POSTGRES_MIN_CONNS: 2
POSTGRES_MAX_CONNS: 5
REDIS_URL: redis:6379
API_ID: 2
redis:
image: redis:7.2.4-alpine3.19
command: redis-server
container_name: rinha_redis
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 10s
timeout: 5s
deploy:
resources:
limits:
cpus: "0.1"
memory: 10MB
db:
image: postgres:16.1-alpine3.19
container_name: rinha_postgres
volumes:
- ./schema.sql:/docker-entrypoint-initdb.d/init.sql
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "5432:5432"
deploy:
resources:
limits:
cpus: "0.6"
memory: 250MB