You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Mauro Data Mapper service](#mauro-data-mapper-service)
22
+
-[build.yml File](#configbuildyml-file)
23
+
-[runtime.yml File](#configruntimeyml-file)
20
24
-[Environment Notes](#environment-notes)
21
25
-[Migrating from Metadata Catalogue](#migrating-from-metadata-catalogue)
22
26
-[Docker](#docker)
@@ -167,72 +171,111 @@ script once per server.
167
171
168
172
Some servers have the 22 SSH port firewalled for external connections. If this is the case you can change the `base_images/sdk_base/ssh/config` file,
169
173
170
-
* comment out the `Hostname` field thats currently active * uncomment both commented out `Hostname` and `Port` fields, this will allow git to work
171
-
using the 443 port which will not be blocked.
174
+
* comment out the `Hostname` field thats currently active * uncomment both commented out `Hostname` and `Port` fields, this will allow git to work using the 443 port which
175
+
will not be blocked.
176
+
172
177
---
173
178
174
179
## Run Environment
175
180
176
-
### postgres service
181
+
By adding variables to the `<service>.environment` section of the docker-compose.yml file you can pass them into the container as environment variables. These will override
182
+
any existing configuration variables which are used by default. Any defaults and normally used environment variables can be found in the relevant service's Dockerfile at
183
+
the `ENV` command.
177
184
178
-
*Please see `postgres/Dockerfile` for all defaults*
185
+
### postgres service
179
186
180
187
*`POSTGRES_PASSWORD` - This sets the postgres user password for the service, as per the documentation at
181
-
[Postgres Docker Hub](https://hub.docker.com/_/postgres), it must be set for a docker postgres container. We have set a default but you can override
182
-
if desired. If you do override it, you will also need to change the `PGPASSWORD` env variable in the mauro-data-mapper section.
183
-
* `DATABASE_USERNAME` - This is the username which will be created inside the Postgres instance to own the database which the MDM service will use.
184
-
The username is also used by the MDM service to connect to the postgres instance, therefore if you change this you *MUST* also supply it in the
185
-
environment args for the MDM service
186
-
* `DATABASE_PASSWORD` - This is the password set for the `DATABASE_USERNAME`. It is the password used by the MDM service to connect to this postgres
187
-
container.
188
+
[Postgres Docker Hub](https://hub.docker.com/_/postgres), it must be set for a docker postgres container. We have set a default but you can override if desired. If you do
189
+
override it, you will also need to change the `PGPASSWORD` env variable in the mauro-data-mapper section.
190
+
*`DATABASE_USERNAME` - This is the username which will be created inside the Postgres instance to own the database which the MDM service will use. The username is also used
191
+
by the MDM service to connect to the postgres instance, therefore if you change this you *MUST* also supply it in the environment args for the MDM service
192
+
*`DATABASE_PASSWORD` - This is the password set for the `DATABASE_USERNAME`. It is the password used by the MDM service to connect to this postgres container.
188
193
189
194
### mauro-data-mapper service
190
195
191
-
*Please see `mauro-data-mapper/Dockerfile` for all defaults*
196
+
Any grails configuration property found in any of the plugin.yml or application.yml files can be overridden through environment variables. They simply need to be provided in
197
+
the "dot notation" form rather than the "YML new line" format.
198
+
199
+
e.g. application.yml
200
+
201
+
```yml
202
+
database:
203
+
host: localhost
204
+
```
205
+
206
+
would be overridden by docker-compose.yml
207
+
208
+
```yml
209
+
services:
210
+
mauro-data-mapper:
211
+
environment:
212
+
database.host: another-host
213
+
214
+
```
215
+
216
+
However to make life simpler and to avoid too many variables in the docker-compose.yml file we have supplied 2 additional methods of overriding the defaults. This replaces all
217
+
of the previous releases environment variables setting in docker-compose.yml.
218
+
219
+
The preference order for loaded sources of properties is
220
+
221
+
1. Environment Variables
222
+
2. runtime.yml
223
+
3. build.yml
224
+
4. application.yml
225
+
5. plugin.yml - there are multiple versions of these as each plugin we build may supply their own
226
+
227
+
#### config/build.yml File
228
+
229
+
The build.yml file is built into the MDM service when the image is built and is a standard grails configuration file. Therefore any properties which can be safely set at build
230
+
time for the image should be set into this file. This includes any properties which may be shared between multiple instances of MDM which all start from the same image.
192
231
193
-
### Required to be overridden
232
+
Our recommendation is that if only running 1 instance of MDM from 1 cloned repository then you should load all your properties into the build.yml file. For this reason we have
233
+
supplied the build.yml file with all the properties which we either require to be overridden or expect may want to be overridden.
194
234
195
-
The following variables need to be overriden/set when starting up a new mauro-data-mapper image. Usually this is done in the docker-compose.yml file.
196
-
It should not be done in the Dockerfile as each instance which starts up may use different values.
235
+
#### config/runtime.yml File
197
236
198
-
* `MDM_FQ_HOSTNAME` - The FQDN of the server where the catalogue will be accessed
199
-
* `MDM_PORT` - The port used to access the catalogue
200
-
* `MDM_AUTHORITY_URL` - The full URL to the location of the catalogue. This is considered a unique identifier to distinguish any instance from
201
-
another and therefore no 2 instances should use the same URL.
202
-
* `MDM_AUTHORITY_NAME` - A unique name used to distinguish a running MDM instance.
203
-
* `EMAIL_USERNAME` - To allow the catalogue to send emails this needs to be a valid username for the `EMAIL_HOST`
204
-
* `EMAIL_PASSWORD` - To allow the catalogue to send emails this needs to be a valid password for the `EMAIL_HOST` and `EMAIL_USERNAME`
205
-
* `EMAIL_HOST` - This is the FQDN of the mail server to use when sending emails
237
+
The runtime.yml file will be loaded into the container via the docker-compose.yml file. This is intended as the replacement for environment variable overrides, where each
238
+
running container might have specifically set properties which differ from a common shared image.
239
+
240
+
**NOTE: Do not change the environment variable `runtime.config.path` as this denotes the path inside the container where the config file will be found**
241
+
242
+
#### Required to be overridden
243
+
244
+
The following variables need to be overriden/set when starting up a new mauro-data-mapper image. Usually this is done in the docker-compose.yml file. It should not be done in
245
+
the Dockerfile as each instance which starts up may use different values.
246
+
247
+
*`grails.cors.allowedOrigins` - Should be set to a single FQDN URL which is the host where MDM will be accessed from. If using a proxy to break SSL then the origin would be
248
+
the hostname where the proxy sits, not the host of the server running the docker containers. The origin must include the protocol, i.e. https or http
249
+
*`maurodatamapper.authority.name` - The full URL to the location of the catalogue. This is considered a unique identifier to distinguish any instance from another and
250
+
therefore no 2 instances should use the same URL.
251
+
*`maurodatamapper.authority.url` - A unique name used to distinguish a running MDM instance.
252
+
*`simplejavamail.smtp.username` - To allow the catalogue to send emails this needs to be a valid username for the `simplejavamail.smtp.host`
253
+
*`simplejavamail.smtp.password` - To allow the catalogue to send emails this needs to be a valid password for the `simplejavamail.smtp.host`
254
+
and `simplejavamail.smtp.username`
255
+
*`simplejavamail.smtp.host` - This is the FQDN of the mail server to use when sending emails
206
256
207
257
### Optional
208
258
209
-
* `PGPASSWORD` - This is the postgres user's password for the postgres server. This is an environment variable set to allow the MDM service to
210
-
wait till the postgres service has completely finished starting up. It is only used to confirm the Postgres server is running and databases exist.
211
-
After this it is not used again. **If you change `POSTGRES_PASSWORD` you must change this to match**
212
-
*`CATALINA_OPTS` - Java Opts to be passed to Tomcat
213
-
*`DATABASE_HOST` - The host of the database. If using docker-compose this should be left as `postgres` or changed to the name of the database service
214
-
*`DATABASE_PORT` - The port of the database
215
-
*`DATABASE_NAME` - The name of the database which the catalogue data will be stored in
216
-
*`DATABASE_USERNAME` - Username to use to connect to the database. See the Postgres service environment variables for more information.
217
-
*`DATABASE_PASSWORD` - Password to use to connect to the database. See the Postgres service environment variables for more information.
218
-
*`EMAIL_PORT` - The port to use when sending emails
219
-
*`EMAIL_TRANSPORTSTRATEGY` - The transport strategy to use when sending emails
220
-
*`SEARCH_INDEX_BASE` - The directory to store the lucene index files in
221
-
*`EMAILSERVICE_URL` - The url to the special email service, this will result in the alternative email system being used
222
-
*`EMAILSERVICE_USERNAME` - The username for the email service needs to be valid for `EMAIL_SERVICE_URL`
223
-
*`EMAILSERVICE_PASSWORD` - The password for the email service needs to be valid for `EMAIL_SERVICE_URL`
259
+
*`PGPASSWORD` - This is the postgres user's password for the postgres server. This is an environment variable set to allow the MDM service to wait till the postgres service
260
+
has completely finished starting up. It is only used to confirm the Postgres server is running and databases exist. After this it is not used again. **If you
261
+
change `POSTGRES_PASSWORD` you must change this to match**
262
+
**This can ONLY be overridden in the docker-compose.yml file**
263
+
* `CATALINA_OPTS` - Java Opts to be passed to Tomcat **This can ONLY be overridden in the docker-compose.yml file**
264
+
* `database.host` - The host of the database. If using docker-compose this should be left as `postgres` or changed to the name of the database service
265
+
* `database.port` - The port of the database
266
+
* `database.name` - The name of the database which the catalogue data will be stored in
267
+
* `dataSource.username` - Username to use to connect to the database. See the Postgres service environment variables for more information.
268
+
* `dataSource.password` - Password to use to connect to the database. See the Postgres service environment variables for more information.
269
+
* `simplejavamail.smtp.port` - The port to use when sending emails
270
+
* `simplejavamail.smtp.transportstrategy` - The transport strategy to use when sending emails
271
+
* `hibernate.search.default.indexBase` - The directory to store the lucene index files in
224
272
225
273
### Environment Notes
226
274
227
-
**Database** The system is designed to use the postgres service provided in the docker-compose file, therefore there should be no need to alter any of
228
-
these settings. Only make alterations if running postgres as a separate service outside of docker-compose.
229
-
230
-
**MDM_FQ_HOSTNAME** & **MDM_PORT** The provided values will be used to define the CORS allowed origins. The port will be used to define http or https
231
-
(443), if its not 80 or 443 then it will be added to the url generated. The host must be the host used in the web url when accessing the catalogue
232
-
in a web browser.
275
+
**Database** The system is designed to use the postgres service provided in the docker-compose file, therefore there should be no need to alter any of these settings. Only
276
+
make alterations if running postgres as a separate service outside of docker-compose.
233
277
234
-
**Email** The standard email properties will allow emails to be sent to a specific SMTP server. The `emailservice` properties override this and
235
-
send the email to the specified email service which will then forward it onto our email SMTP server.
278
+
**Email** The standard email properties will allow emails to be sent to a specific SMTP server.
236
279
237
280
---
238
281
@@ -330,7 +373,7 @@ We recommend adding the following lines to the appropriate bash profile file:
330
373
331
374
```bash
332
375
alias docker-compose-dev="docker-compose -f docker-compose.yml -f docker-compose.dev.yml"
333
-
alias docker-compose-prod="docker-compose -f docker-compose.yml -f docker-compose.dev.yml"
376
+
alias docker-compose-prod="docker-compose -f docker-compose.yml -f docker-compose.prod.yml"
334
377
```
335
378
This will allow you to start compose in dev mode without all the extra file definitions
0 commit comments