-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
73 lines (68 loc) · 1.74 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
version: "3.5"
services:
spring_db:
container_name: spring_db
image: postgres:latest
command: postgres -c checkpoint_timeout=600 -c max_wal_size=4096 -c synchronous_commit=0 -c fsync=0 -c full_page_writes=0
environment:
POSTGRES_PASSWORD: spring_db
POSTGRES_USER: spring_db
POSTGRES_DB: spring_db
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d spring_db -U spring_db" ]
interval: 5s
timeout: 5s
retries: 5
deploy:
resources:
limits:
# Note que a soma de todos os limites dos serviços
# aqui declarados é de 1.5 unidades de CPU e 550MB
# de memória. A distribuição feita aqui é apenas
# um exemplo – distribua como quiser.
cpus: "0.40"
memory: "180MB"
ports:
- "5432:5432"
spring-one: &spring-api
hostname: spring-one
image: nortana/rinha-de-backend-2024-q1-spring:0.0.1-SNAPSHOT
container_name: spring-one
environment:
spring.datasource.url: jdbc:postgresql://spring_db:5432/spring_db
ports:
- "8081:8080"
depends_on:
spring_db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.50"
memory: "180MB"
spring-two:
<<: *spring-api
hostname: spring-two
container_name: spring-two
ports:
- "8082:8080"
nginx:
container_name: nginx-load-balance
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- spring-one
- spring-two
- spring_db
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.10"
memory: "10MB"
networks:
default:
driver: bridge
name: rinha-nginx-2024q1