-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
135 lines (126 loc) · 2.82 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
version: "2.1"
services:
consul:
image: consul:latest
container_name: consul
ports:
- "8500:8500"
networks:
develop:
ipv4_address: 172.20.10.1
marine-service-1:
image: egormit/marine-service
container_name: marine-service-1
depends_on:
- db
- consul
environment:
- DATABASE_HOST=soa-db
- DATABASE_PORT=5432
- DATABASE_USERNAME=admin
- DATABASE_PASSWORD=admin
- CONSUL_HOST=consul
- CONSUL_PORT=8500
networks:
develop:
ipv4_address: 172.20.1.1
ports:
- "8000:8000"
marine-service-2:
image: egormit/marine-service
container_name: marine-service-2
depends_on:
- db
- consul
environment:
- DATABASE_HOST=soa-db
- DATABASE_PORT=5432
- DATABASE_USERNAME=admin
- DATABASE_PASSWORD=admin
- CONSUL_HOST=consul
- CONSUL_PORT=8500
networks:
develop:
ipv4_address: 172.20.1.2
ports:
- "9000:8000"
starship-service-1:
image: egormit/starship-service
container_name: starship-service-1
depends_on:
- db
- consul
environment:
- DATABASE_HOST=soa-db
- DATABASE_PORT=5432
- DATABASE_USERNAME=admin
- DATABASE_PASSWORD=admin
- MARINES_HOST=haproxy
- MARINES_PORT=10000
- CONSUL_HOST=consul
- CONSUL_PORT=8500
networks:
develop:
ipv4_address: 172.20.1.3
ports:
- "8081:8081"
starship-service-2:
image: egormit/starship-service
container_name: starship-service-2
depends_on:
- db
- consul
environment:
- DATABASE_HOST=soa-db
- DATABASE_PORT=5432
- DATABASE_USERNAME=admin
- DATABASE_PASSWORD=admin
- MARINES_HOST=haproxy
- MARINES_PORT=10000
- CONSUL_HOST=consul
- CONSUL_PORT=8500
networks:
develop:
ipv4_address: 172.20.1.4
ports:
- "8082:8081"
frontend-service:
image: egormit/frontend-service
container_name: frontend-service
ports:
- "8080:8080"
networks:
- develop
db:
image: postgres
container_name: soa-db
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=soa-db
command: postgres -p 5432
networks:
- develop
ports:
- "5432:5432"
haproxy:
image: "haproxy:2.2-alpine"
container_name: haproxy
depends_on:
- marine-service-1
- marine-service-2
- starship-service-1
- starship-service-2
ports:
- "10000:10000"
- "10100:10100"
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
networks:
- develop
networks:
develop:
external:
name: develop
# Перед запуском создать сеть:
# docker network create develop --subnet=172.20.0.0/16