-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
70 lines (66 loc) · 1.47 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
69
70
version: '3.9'
services:
api1: &api
image: saulomendonca/rinha-202401-rails:latest
hostname: rinha-api-1
command: "./bin/rails server"
environment:
- RUBY_YJIT_ENABLE=1
- RAILS_ENV=production
- RAILS_LOG_LEVEL=fatal
- RAILS_MAX_THREADS=40
- RAILS_MASTER_KEY=274a8e6d23a3c69bdfc361ac668bee8e
- WEB_CONCURRENCY=0
- POSTGRES_HOST=db
- POSTGRES_DB=rinha_production
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
depends_on:
db:
condition: service_healthy
ports:
- "3000"
deploy:
resources:
limits:
cpus: '0.45'
memory: '170MB'
api2:
<<: *api
hostname: rinha-api-2
entrypoint: "/rails/bin/docker-entrypoint-2"
db:
image: postgres:16.2-alpine
command:
"postgres -c 'max_connections=500'"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
environment:
- POSTGRES_DB=rinha_production
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
ports:
- "5432:5432"
deploy:
resources:
limits:
cpus: '0.4'
memory: '190MB'
nginx:
image: nginx
container_name: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- 9999:9999
depends_on:
- api1
- api2
deploy:
resources:
limits:
cpus: '0.2'
memory: '20MB'