-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
105 lines (95 loc) · 2.55 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
version: "3"
services:
# NOTE: do not change any of the services names
# When docker-compose up this file access the webpage
# through the balancer located at 172.18.0.2:443
haproxy:
image: haproxy
ports:
- "80:80"
container_name: 'clicknbuy_cnbhaproxy'
volumes:
- ./haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
- ./haproxy/key.pem:/etc/haproxy/key.pem
networks:
main:
ipv4_address: 172.18.0.2
depends_on:
- cnbapp1
- cnbapp2
cnbapp1:
build: .
container_name: 'cnbapp1'
restart: "on-failure"
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://cnbdb:3306/clickandbuyDB
- SPRING_DATASOURCE_USERNAME=userDB
- SPRING_DATASOURCE_PASSWORD=password
ports:
- "8002:8443"
expose:
- "8002"
networks:
main:
ipv4_address: 172.18.0.5
depends_on:
- cnbdb
cnbapp2:
build: .
container_name: 'cnbapp2'
restart: "on-failure"
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://cnbdb:3306/clickandbuyDB
- SPRING_DATASOURCE_USERNAME=userDB
- SPRING_DATASOURCE_PASSWORD=password
ports:
- "8001:8443"
expose:
- "8001"
networks:
main:
ipv4_address: 172.18.0.6
depends_on:
- cnbdb
cnbdb:
image: mysql:latest
restart: "on-failure"
environment:
- MYSQL_ROOT_PASSWORD=admi1234
- MYSQL_USER=userDB
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=clickandbuyDB
ports:
- "8084:3306"
expose:
- "3306"
networks:
main:
ipv4_address: 172.18.0.3
volumes:
- ./cnbdbvol:/var/lib/mysql
cnbinternal:
build: ./internal-service
restart: "on-failure"
ports:
- "8081:8081"
networks:
main:
ipv4_address: 172.18.0.4
cnbinternalbackup:
build: ./internal-service
restart: "on-failure"
ports:
- "8082:8081"
networks:
main:
ipv4_address: 172.18.0.7
networks:
main:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.18.0.2/16
volumes:
cnbdbvol: