-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
178 lines (160 loc) · 4.66 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
version: '3.7'
## BASE VALUES (reused in the services)
x-tomcat: &tomcat
image: tomcat:jdk8
restart: unless-stopped
ports:
- "4000-4100:8080"
# volumes:
# # difference?! exploded seems more speedy
# - ./target/pollweb.war:/usr/local/tomcat/webapps/sose-1920.war
# - ./microservices/person/target/sose:/usr/local/tomcat/webapps/sose
# environment:
# # env parameters for java app (not used for now)
# JDBC_URL: jdbc:mysql://mariadb:3306/sosedb?connectTimeout=0&socketTimeout=0&autoReconnect=true
# JDBC_USER: sose
# JDBC_PASS: sose
x-mariadb: &mariadb
image: mariadb:10.5.1
restart: unless-stopped
environment:
# or set more detailed access policy in docker/db-init.sql
MYSQL_ROOT_PASSWORD: sose
MYSQL_DATABASE: sosedb
MYSQL_USER: sose
MYSQL_PASSWORD: sose
x-eureka: &eureka
EUREKA_SERVER_URI: ${EUREKA_SERVER_URI}
EUREKA_SERVER_PORT: '8080'
EUREKA_BASE_PATH: ''
## SERVICES
services:
frontend:
image: nginx:stable-alpine
restart: unless-stopped
volumes:
- ./frontend/docker/dist:/usr/share/nginx/html
- ./frontend/docker/ngnix.frontend.conf:/etc/nginx/conf.d/ngnix.wyw.template
ports:
- "3000:80"
- "3443:443"
environment:
NGINX_HOST: ${FRONTEND_HOST:-localhost}
command: /bin/ash -c "envsubst '$$NGINX_HOST' < /etc/nginx/conf.d/ngnix.wyw.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
# PERSON MS (inherit from base microservice)
person-ws:
<<: *tomcat
depends_on:
- person-db
volumes:
- ./microservices/person/target/sose:/usr/local/tomcat/webapps/ROOT
environment: *eureka
networks:
- microservices
person-db:
<<: *mariadb
volumes:
# only naming/label volume ("docker-compose down -v" to erase)
- person-db-data:/var/lib/mysql
# executing only on create container (first "docker-compose up")
- ./microservices/person/db/db-init.sql:/docker-entrypoint-initdb.d/db-init.sql
networks:
- microservices
film-ws:
<<: *tomcat
depends_on:
- film-db
volumes:
- ./microservices/film/target/sose:/usr/local/tomcat/webapps/ROOT
environment:
<<: *eureka
OMDB_API_KEY: ${OMDB_API_KEY}
networks:
- microservices
film-db:
<<: *mariadb
volumes:
# only naming/label volume ("docker-compose down -v" to erase)
- film-db-data:/var/lib/mysql
# executing only on create container (first "docker-compose up")
- ./microservices/film/db/db-init.sql:/docker-entrypoint-initdb.d/db-init.sql
networks:
- microservices
user-ws:
<<: *tomcat
depends_on:
- user-db
volumes:
- ./microservices/user/target/sose:/usr/local/tomcat/webapps/ROOT
environment: *eureka
networks:
- microservices
user-db:
<<: *mariadb
volumes:
# only naming/label volume ("docker-compose down -v" to erase)
- user-db-data:/var/lib/mysql
# executing only on create container (first "docker-compose up")
- ./microservices/user/db/db-init.sql:/docker-entrypoint-initdb.d/db-init.sql
networks:
- microservices
watched-film-ws:
<<: *tomcat
depends_on:
- watched-film-db
volumes:
- ./microservices/watched-film/target/sose:/usr/local/tomcat/webapps/ROOT
environment:
<<: *eureka
OMDB_API_KEY: ${OMDB_API_KEY}
networks:
- microservices
watched-film-db:
<<: *mariadb
volumes:
# only naming/label volume ("docker-compose down -v" to erase)
- watched-film-db-data:/var/lib/mysql
# executing only on create container (first "docker-compose up")
- ./microservices/watched-film/db/db-init.sql:/docker-entrypoint-initdb.d/db-init.sql
networks:
- microservices
eureka-registry:
<<: *tomcat
ports:
- "8761:8080"
volumes:
- ./microservices/eureka-registry/target/sose:/usr/local/tomcat/webapps/ROOT
environment:
HOSTNAME: ${EUREKA_SERVER_URI}
networks:
- microservices
zuul-proxy:
<<: *tomcat
ports:
- "8762:8080"
volumes:
- ./microservices/zuul/target/sose:/usr/local/tomcat/webapps/ROOT
environment: *eureka
networks:
- microservices
adminer:
# use for disable any service
#build: './utils/docker-disable'
#image: disable:1.0
image: adminer:4.7.6
restart: unless-stopped
environment:
# https://www.adminer.org/en/plugins/
ADMINER_PLUGINS: 'file-upload tinymce'
ADMINER_DEFAULT_SERVER: 'person-db'
ports:
- "5000:8080"
networks:
- microservices
networks:
microservices:
volumes:
person-db-data:
film-db-data:
user-db-data:
watched-film-db-data: