-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
111 lines (100 loc) · 2.98 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
version: '3.7'
services:
lbweb:
build:
context: ./nginxweb
dockerfile: Dockerfile
ports:
- "3000:3000"
depends_on:
- frontend1
- frontend2
restart: always
networks:
- default
- nginx_network
frontend1:
build: ./interface
volumes:
- './interface:/app'
ports:
- 8081:8080
networks:
- default
- nginx_network
frontend2:
build: ./interface
volumes:
- './interface:/app'
ports:
- 8082:8080
networks:
- default
- nginx_network
lb:
build:
context: ./nginx
dockerfile: Dockerfile
ports:
- "7777:7777"
depends_on:
- backend1
- backend2
restart: always
networks:
- default
vetgest_db:
image: mysql:8.0.17
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8 --collation-server=utf8_general_ci
environment:
MYSQL_DATABASE: vetgest
MYSQL_ROOT_PASSWORD: pass
volumes:
- ./sql:/docker-entrypoint-initdb.d
ports:
- 3308:3306
networks:
- network_backend
cap_add:
- SYS_NICE # CAP_SYS_NICE
backend1:
build:
context: ./api
#command: ["sleep", "1000000"]
command: ["rm -rf", "target/"]
command: ["./wait-for-it.sh", "vetgest_db:3306", "--", "mvn", "install"]
command: ["mvn", "spring-boot:run"]
environment:
WAIT_HOSTS: mysql:3306
SPRING_DATASOURCE_URL: jdbc:mysql://vetgest_db:3306/vetgest?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Europe/Lisbon
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: pass
ports:
- 9091:9090
networks:
- network_backend
- default
restart: always
backend2:
build:
context: ./api
#command: ["sleep", "1000000"]
command: ["rm -rf", "target/"]
command: ["./wait-for-it.sh", "vetgest_db:3306", "--", "mvn", "install"]
command: ["mvn", "spring-boot:run"]
environment:
WAIT_HOSTS: mysql:3306
SPRING_DATASOURCE_URL: jdbc:mysql://vetgest_db:3306/vetgest?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Europe/Lisbon
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: pass
ports:
- 9092:9090
networks:
- network_backend
- default
restart: always
networks:
network_backend:
driver: "bridge"
nginx_network:
driver: "bridge"