-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
90 lines (85 loc) · 1.66 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
version: "3.8"
services:
api01: &api
#build:
# context: .
# dockerfile: Dockerfile
image: whyakari/rinha:2.0
hostname: api01
environment:
- DB_HOSTNAME=db
- DB_USER=root
- DB_PASSWORD=love
- DB_NAME=rinha
- DB_PORT=3306
ports:
- "3001:3000"
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.2"
memory: "100MB"
api02:
<<: *api
hostname: api02
environment:
- DB_HOSTNAME=db
- DB_USER=root
- DB_PASSWORD=love
- DB_NAME=rinha
- DB_PORT=3306
ports:
- "3002:3000"
nginx:
image: nginx:latest
command: ["nginx", "-g", "daemon off;"]
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.15"
memory: "20MB"
db:
image: mariadb:latest
restart: always
container_name: db
hostname: db
environment:
- MYSQL_ROOT_PASSWORD=love
- MYSQL_DATABASE=rinha
- MYSQL_PASSWORD=love
ports:
- "3306:3306"
volumes:
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql
healthcheck:
test:
[
"CMD",
"healthcheck.sh",
"--su-mysql",
"--connect",
"--innodb_initialized"
]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
deploy:
resources:
limits:
cpus: "0.95"
memory: "310MB"
networks:
default:
driver: bridge
name: rinha-nginx-2024q1