-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose-local-arm.yml
123 lines (118 loc) · 2.8 KB
/
docker-compose-local-arm.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
version: '3.9'
name: 'rinha-brunoborges'
services:
api1:
build:
context: .
dockerfile: src/main/docker/Dockerfile.arm
hostname: api1
environment:
- SERVER_PORT=8080
- DATABASE_URL=jdbc:postgresql://db-postgresql:5432/rinhadb
- DATABASE_USERNAME=rinha
- DATABASE_PASSWORD=rinha123
- OTHER_API_URL=http://api2:8080
depends_on:
db-postgresql:
condition: service_healthy
ulimits:
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: '0.35'
memory: '896MB'
networks:
- app-network
healthcheck:
test: curl -o /dev/null -s --retry 0 --head http://localhost:8080/ || exit 1
interval: 10s
retries: 60
start_period: 20s
timeout: 5s
api2:
build:
context: .
dockerfile: src/main/docker/Dockerfile.arm
hostname: api2
environment:
- SERVER_PORT=8080
- DATABASE_URL=jdbc:postgresql://db-postgresql:5432/rinhadb
- DATABASE_USERNAME=rinha
- DATABASE_PASSWORD=rinha123
- OTHER_API_URL=http://api1:8080
volumes:
- ./ddl.sql:/docker-entrypoint-initdb.d/ddl.sql
depends_on:
db-postgresql:
condition: service_healthy
ulimits:
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: '0.35'
memory: '896MB'
networks:
- app-network
healthcheck:
test: curl -o /dev/null -s --retry 0 --head http://localhost:8080/ || exit 1
interval: 10s
retries: 60
start_period: 20s
timeout: 5s
nginx:
image: nginx:latest
platform: linux/arm64
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
api1:
condition: service_healthy
api2:
condition: service_healthy
ports:
- "9999:9999"
networks:
- app-network
ulimits:
nofile:
soft: 1000000
hard: 1000000
deploy:
resources:
limits:
cpus: '0.15'
memory: '256MB'
db-postgresql:
image: postgres:latest
platform: linux/arm64
command: 'postgres -c max_connections=200 -c shared_buffers=512MB -c wal_buffers=64MB -c synchronous_commit=off -c fsync=off -c full_page_writes=off'
hostname: db-postgresql
environment:
- POSTGRES_PASSWORD=rinha123
- POSTGRES_USER=rinha
- POSTGRES_DB=rinhadb
ports:
- "5432:5432"
volumes:
- ./ddl.sql:/docker-entrypoint-initdb.d/ddl.sql
deploy:
resources:
limits:
cpus: '0.65'
memory: '1GB'
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
networks:
app-network: