-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathdocker-compose.yml
95 lines (86 loc) · 2.14 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
version: "3"
services:
consul-server-leader:
image: consul:latest
container_name: consul-server-leader
command: "agent -server -bootstrap -ui -node=consul-server-leader -client=0.0.0.0"
environment:
- CONSUL_BIND_INTERFACE=eth0
ports:
- "8500:8500"
networks:
- microservice
# consul-server-1:
# image: consul:latest
# container_name: consul-server-1
# command: "agent -server -node=consul-server-1 -join=consul-server-leader -client=0.0.0.0"
# environment:
# - CONSUL_BIND_INTERFACE=eth0
# networks:
# - microservice
# depends_on:
# - "consul-server-leader"
# consul-server-2:
# image: consul:latest
# container_name: consul-server-2
# command: "agent -server -node=consul-server-2 -join=consul-server-leader -client=0.0.0.0"
# environment:
# - CONSUL_BIND_INTERFACE=eth0
# networks:
# - microservice
# depends_on:
# - "consul-server-leader"
# consul-client:
# image: consul:latest
# container_name: consul-client
# command: "agent -client -node=consul-client -join=consul-server-leader -client=0.0.0.0"
# environment:
# - CONSUL_BIND_INTERFACE=eth0
# networks:
# - microservice
# depends_on:
# - "consul-server-leader"
microservice-1:
build:
context: .
container_name: "microservice-1"
command: "php bin/hyperf.php start"
depends_on:
- "consul-server-leader"
volumes:
- ./www/microservice-1:/var/www
networks:
- microservice
tty: true
microservice-2:
build:
context: .
container_name: "microservice-2"
command: "php bin/hyperf.php start"
depends_on:
- "consul-server-leader"
volumes:
- ./www/microservice-2:/var/www
networks:
- microservice
tty: true
app:
build:
context: .
container_name: "app"
command: "php bin/hyperf.php start"
depends_on:
- "microservice-1"
volumes:
- ./www/web:/var/www
ports:
- "9501:9501"
networks:
- microservice
tty: true
networks:
microservice:
driver: bridge
volumes:
microservice:
driver: local