-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
237 lines (224 loc) · 7.41 KB
/
Copy pathdocker-compose.yml
File metadata and controls
237 lines (224 loc) · 7.41 KB
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
version: "3.7"
x-logging:
&default-logging
driver: "json-file"
options:
max-size: "2m"
max-file: "2"
services:
mongo:
image: mongo:4.4.4
hostname: mongo
container_name: mongo
restart: unless-stopped
volumes:
- ./docker_volumes/mongodb:/data/db
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
networks:
- petstore-network
logging: *default-logging
mariadb:
image: mariadb:10.5.9
hostname: mariadb
container_name: mariadb
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ChangeMe
MYSQL_ROOT_HOST: "%"
MYSQL_USER: test
MYSQL_PASSWORD: password
MYSQL_DATABASE: hydra
healthcheck:
test: "mysqladmin ping -u root -p$${MYSQL_ROOT_PASSWORD}"
start_period: 10s
timeout: 20s
retries: 10
volumes:
- ./docker_volumes/mariadb-data:/var/lib/mysql
ports:
- 3306:3306
networks:
- petstore-network
logging: *default-logging
mysql:
image: mysql:8.0.23
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: ChangeMe
# MYSQL_ROOT_HOST: "%"
MYSQL_USER: test
MYSQL_PASSWORD: password
healthcheck:
test: "mysqladmin ping -u root -p$${MYSQL_ROOT_PASSWORD}"
start_period: 10s
timeout: 20s
retries: 10
volumes:
- ./docker_volumes/mysql-data:/var/lib/mysql
# See *.sql scripts in ./MYSQL_DB_Setup/DockerSartupScripts that are run on the container creation
- ./MYSQL_DB_Setup/DockerSartupScripts:/docker-entrypoint-initdb.d
ports:
- 3306:3306
cap_add:
- SYS_NICE # CAP_SYS_NICE
networks:
- petstore-network
logging: *default-logging
postgresd:
image: postgres:13
hostname: postgresd
container_name: postgresd
restart: unless-stopped
environment:
- POSTGRES_USER=hydra
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=hydra
volumes:
- ./docker_volumes/postgressql:/var/lib/postgresql/data
ports:
- 5432:5432
networks:
- petstore-network
logging: *default-logging
adminer:
image: adminer
hostname: adminer
container_name: adminer
restart: unless-stopped
depends_on:
- mariadb
# - mysql
ports:
- 8081:8080
networks:
- petstore-network
logging: *default-logging
portainer:
image: portainer/portainer-ce:2.5.0-alpine
hostname: portainer
container_name: portainer
restart: unless-stopped
# Admin User password: Password01
volumes:
- ./docker_volumes/portainer_data:/data
- /var/run/docker.sock:/var/run/docker.sock
ports:
- 8000:8000
- 9000:9000
networks:
- petstore-network
logging: *default-logging
rest-service:
hostname: rest-service
container_name: rest-service
restart: unless-stopped
build:
context: ./
dockerfile: Dockerfile.local
volumes:
- .:/app/
environment:
MONGODB_CONNECT_URL: mongodb://mongo-models:27017/gaming-model-db
DEALER_SERVICE_URL: http://service-dealer:10010
MASTER_LIST_SERVICE_URL: http://service-model:10010
LOG_EXPRESSION: gaming-service-model
LOG_LEVEL: debug
# command:
# - bash
# - -c
# # Install node-sass to get the host specific bindings. OSX and linux are different
# - yarn start
networks:
- petstore-network
logging: *default-logging
keycloak:
image: quay.io/keycloak/keycloak:latest
hostname: keycloak
container_name: keycloak
restart: unless-stopped
depends_on:
mysql:
#mariadb:
condition: service_healthy
environment:
# mariadb fails!!!!
#DB_VENDOR: mariadb
#DB_ADDR: mariadb
DB_VENDOR: mysql
DB_ADDR: mysql
DB_PORT: 3306
DB_DATABASE: keycloak
DB_USER: keycloak
DB_PASSWORD: password
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KEYCLOAK_HTTPS_PORT: 8443
# Uncomment the line below if you want to specify JDBC parameters. The parameter below is just an example,
# and it shouldn't be used in production without knowledge. It is highly recommended that you read the
# MySQL JDBC driver documentation in order to use it.
JDBC_PARAMS: "useSSL=FALSE&allowPublicKeyRetrieval=TRUE&connectTimeout=60000"
JAVA_OPTS: "-Djboss.as.management.blocking.timeout=3600"
#------------------------------------------------------------------------------------------------------------
# Export Realm, see https://hub.docker.com/r/jboss/keycloak/
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Import Realm, see https://hub.docker.com/r/jboss/keycloak/
# KEYCLOAK_IMPORT: /config/nodejs-test-realm.json
#------------------------------------------------------------------------------------------------------------
# command:
# # see https://stackoverflow.com/questions/61184888/how-to-import-multiple-realm-in-keycloak
# - "-b 0.0.0.0"
# - "-Dkeycloak.migration.action=import"
# - "-Dkeycloak.migration.provider=singleFile"
# - "-Dkeycloak.migration.file=/config/nodejs-test-realm.json"
# - "-Dkeycloak.migration.strategy=IGNORE_EXISTING"
# volumes:
# - ./test/fixtures/auth-utils/nodejs-test-realm.json:/config/nodejs-test-realm.json
ports:
- 8080:8080
- 8443:8443
- 9990:9990
healthcheck:
test: "curl -f http://localhost:8080/auth || exit 1"
start_period: 10s
networks:
- petstore-network
logging: *default-logging
networks:
petstore-network:
name: docker-petstore-network
# ------------------------------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------------------------------
# http://localhost:8080/auth/admin/master/console
#
# https://github.com/keycloak/keycloak-nodejs-connect
# https://github.com/keycloak/keycloak-nodejs-admin-client
# https://www.keycloak.org/docs/latest/securing_apps/index.html#_nodejs_adapter
#
# Very good example app:
# https://github.com/v-ladynev/keycloak-nodejs-example
#
# ------------------------------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------------------------------
# DOCKER WINDOWS PORT BINDING ERROR
# =====================================
# ERROR:
# ------
# Ports are not available: listen tcp 0.0.0.0:8022:
# bind: An attempt was made to access a socket in a way forbidden by its access permissions
#
# SOLUTION:
# ---------
# from admin command prompt run the following two commands:
# sc stop winnat
#
# Notes:
# sc qc winnat
# sc query winnat
# "C:\Program Files\Docker\Docker\Docker Desktop.exe"
# DO NOT "sc config WinNat start=demand" as docker will crash on startup!!!
# ------------------------------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------------------------------------------------------------------