-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
65 lines (58 loc) · 1.26 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
version: "3.5"
services:
dbmysql:
image: mysql:5.7
restart: always
environment:
- MYSQL_DATABASE=rinha
- MYSQL_USER=user
- MYSQL_PASSWORD=password
- MYSQL_ROOT_PASSWORD=password
volumes:
- ./mysql-init.sql:/docker-entrypoint-initdb.d/mysql-init.sql
healthcheck:
test: ["CMD", "mysqladmin", "-uuser", "-ppassword", "ping", "-h", "localhost"]
timeout: 15s
retries: 3
network_mode: host
deploy:
resources:
limits:
cpus: "0.5"
memory: "250MB"
nginx:
image: nginx
restart: on-failure
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- app1
- app2
network_mode: host
deploy:
resources:
limits:
cpus: "0.2"
memory: "50MB"
app1: &app1
image: wladimirteixeiraneto/rinha:latest
hostname: app1
restart: on-failure
depends_on:
dbmysql:
condition: service_healthy
network_mode: host
environment:
- PORT=5001
#- DB_HOST=dbmysql
deploy:
resources:
limits:
cpus: "0.4"
memory: "125MB"
app2:
<<: *app1
hostname: app2
network_mode: host
environment:
- PORT=5002