-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
94 lines (86 loc) · 2.02 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
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.9'
name: 'rinha-de-backend'
services:
spring-api1:
image: willrodrigues/rinha-spring-api:latest
hostname: spring-api1
environment:
- DATABASE_URL=jdbc:postgresql://db-postgresql:5432/rinhadb
- DATABASE_USERNAME=rinha
- DATABASE_PASSWORD=rinha123
- HIKARI_CONNECTION_TIMEOUT=40000
- HIKARI_MAXIMUM_POOL_SIZE=300
- HIKARI_MINIMUM_IDLE=300
depends_on:
db-postgresql:
condition: service_healthy
deploy:
resources:
limits:
cpus: '0.3'
memory: '0.7GB'
networks:
- app-network
spring-api2:
image: willrodrigues/rinha-spring-api:latest
hostname: spring-api2
environment:
- SERVER_PORT=8000
- DATABASE_URL=jdbc:postgresql://db-postgresql:5432/rinhadb
- DATABASE_USERNAME=rinha
- DATABASE_PASSWORD=rinha123
- HIKARI_CONNECTION_TIMEOUT=40000
- HIKARI_MAXIMUM_POOL_SIZE=300
- HIKARI_MINIMUM_IDLE=300
depends_on:
db-postgresql:
condition: service_healthy
deploy:
resources:
limits:
cpus: '0.3'
memory: '0.7GB'
networks:
- app-network
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- spring-api1
- spring-api2
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: '0.1'
memory: '0.1GB'
networks:
- app-network
db-postgresql:
image: postgres:15.2-alpine
command: postgres -c 'max_connections=600'
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 3s
timeout: 5s
retries: 10
environment:
POSTGRES_USER: rinha
POSTGRES_PASSWORD: rinha123
POSTGRES_DB: rinhadb
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 60s
resources:
limits:
cpus: '0.8'
memory: '1.5GB'
networks:
- app-network
networks:
app-network: