-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
101 lines (92 loc) · 1.92 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
95
96
97
98
99
100
101
version: '4'
services:
db1:
image: mysql:latest
restart: always
environment:
- MYSQL_DATABASE=php_docker
- MYSQL_USER=php_docker
- MYSQL_PASSWORD=password
- MYSQL_ALLOW_EMPTY_PASSWORD=1
# MYSQL_ROOT_PASSWORD: password
volumes:
- "./db:/docker-entrypoint-initdb.d"
db2:
image: mysql:latest
restart: always
environment:
- MYSQL_DATABASE=php_docker
- MYSQL_USER=php_docker
- MYSQL_PASSWORD=password
- MYSQL_ALLOW_EMPTY_PASSWORD=1
# MYSQL_ROOT_PASSWORD: password
volumes:
- "./db:/docker-entrypoint-initdb.d"
db3:
image: mysql:latest
restart: always
environment:
- MYSQL_DATABASE=php_docker
- MYSQL_USER=php_docker
- MYSQL_PASSWORD=password
- MYSQL_ALLOW_EMPTY_PASSWORD=1
# MYSQL_ROOT_PASSWORD: password
volumes:
- "./db:/docker-entrypoint-initdb.d"
haproxy:
image: haproxy:latest
ports:
- "3306:3306"
volumes:
- "./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro"
depends_on:
- db1
- db2
- db3
www1:
build:
context: .
dockerfile: Dockerfile
volumes:
- "./movie_database:/var/www/html"
depends_on:
- haproxy
expose:
- "80"
www2:
build:
context: .
dockerfile: Dockerfile
volumes:
- "./movie_database:/var/www/html"
depends_on:
- haproxy
expose:
- "80"
www3:
build:
context: .
dockerfile: Dockerfile
volumes:
- "./movie_database:/var/www/html"
depends_on:
- haproxy
expose:
- "80"
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- www1
- www2
- www3
ports:
- "4000:4000"
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- 8001:80
environment:
- PMA_HOST=haproxy
- PMA_PORT=3306