While this is technically still valid, the auto-deploy technology will replace the need for the content outlined here.

Create docker network

In this environment all the containers will be launched in distinct docker network (it will be called 'dms' in this doc)

Create docker network
docker network create --driver bridge dms

After creating the network, we're starting our postgres and elasticsearch containers. No need to provide ports with '-p' option. Inside the internal network all the ports exposed in Dockerfile are accessible without extra options.

Start DMS Postgres image

Run command:

docker run -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro -v /home/nuxeo/docker/postgres_backup:/backup -v /home/nuxeo/docker/postgres_data:/var/lib/postgresql/data --restart=always --net=dms --name postgres -d practiceinsight/dms_postgresql:2.0

Make sure to map local time and timezone (have to be configured correctly in host).

Start DMS Elasticsearch image

Official image v. 1.4.4 had been used (it is used in official nuxeo docker image, but it's not available now via docker hub). We have not experienced any issues so far with v. 1.7.5 image

Run command:

docker run -v /home/nuxeo/docker/elastic:/usr/share/elasticsearch/data --restart=always --name=elastic -d --net=dms elasticsearch:1.7.5

Start DMS Nuxeo image

We have a static version of nuxeo.conf that is identical in all environments inside the container and a dynamic nuxeo.conf file (having the credentials to connect databases, etc.) that is mapped to the container in the run command. For the below example, the dynamic nuxeo.conf is located in /home/nuxeo/docker/conf.

For information purposes only, here the static nuxeo.conf file that resides inside the container (and is thus immutable):

JAVA_OPTS = -Dfile.encoding=UTF-8 -Dmail.mime.decodeparameters=true -Dmail.mime.decodefilename=true -Djava.util.Arrays.useLegacyMergeSort=true
nuxeo.vcs.blocking-timeout-millis=1000
nuxeo.vcs.max-pool-size=200
elasticsearch.override.pageproviders=default_search,pi_elastic_search
launcher.start.max.wait = 600
nuxeo.templates=postgresql,drive,drive,drive,pi-nx-repository
nuxeo.wizard.done=true
patricia.db.jdbcDriver=com.microsoft.sqlserver.jdbc.SQLServerDriver
nuxeo.db.host=postgres
nuxeo.db.port=5432
nuxeo.db.name=nuxeo
nuxeo.db.user=nuxeo
nuxeo.db.password=nuxeop
org.nuxeo.big.file.size.limit=1000G
nuxeo.path.segment.maxsize=200
nuxeo.db.transactiontimeout=3600  
elasticsearch.addressList=localhost:9300
elasticsearch.clusterName=elasticsearch
elasticsearch.indexName=nuxeo
elasticsearch.indexNumberOfShards=5
elasticsearch.indexNumberOfReplicas=0

 

In the dynamic nuxeo.conf file, the admin determines the memory consumption of nuxeo and database credentials. Any settings given in the dynamic nuxeo.conf file will override the ones in the static nuxeo.conf. Also, new settings can be added that supplement the static ones.

The dynamic nuxeo.conf file is for example (must replace <...> parameters):

nuxeo.conf
JAVA_OPTS=$JAVA_OPTS -Xms1024m -Xmx2048m

patricia.db.jdbcUrl=jdbc:sqlserver://<sql.server.address>:1433;databaseName=<databasename>;integratedSecurity=false
patricia.db.username=<sa-account>
patricia.db.password=<sa-pass>

 

For example, if you want to override the default credentials for postgres from the static nuxeo.conf file, just add this as additional options to your dynamic nuxeo.conf:

nuxeo.conf
JAVA_OPTS=$JAVA_OPTS -Xms1024m -Xmx2048m

patricia.db.jdbcUrl=jdbc:sqlserver://<sql.server.address>:1433;databaseName=<databasename>;integratedSecurity=false
patricia.db.username=<sa-account>
patricia.db.password=<sa-pass>
nuxeo.db.name=nuxeodm
nuxeo.db.user=nuxeodm

IMPORTANT: There shouldn't be any whitespaces before and after '=' sign in conf file

In the run command, we need to add '-p' option, because we will use this port from external network. Also, make sure to map local time and timezone here.

Run command:

docker run -p 8080:8080 -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro -v /home/nuxeo/docker/nuxeo:/var/lib/nuxeo/data -v /home/nuxeo/docker/conf:/etc/nuxeo --restart=always --net=dms --name nuxeo -d practiceinsight/dms_nuxeo:1.9.7.2

Start DMS Casebrowser image

pi-nuxeo.xml needs to be provided to the container, as usual. In the run command, we need to add '-p' option, because we will use this port from external network. Again make sure to map local time and timezone.

Run command:

docker run -p 9080:9080 -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro -v /home/nuxeo/docker/conf:/etc/nuxeo -v /fonts-for-pdf-generation:/root/.windows_fonts:ro --restart=always --net=dms -d --name cb practiceinsight/dms_casebrowser:1.9.7.2

Start DMS service container

Requirements to run:

  1. Docker socket must be mounted to the container
  2. HOSTNAME variable must be provided (will be used in generated email messages)
  3. EMAIL variable must be provided (will be used in generated email messages as a list of recipients)
  4. CONTAINER_NUMBER variable must be provided for monitoring scripts (it's monitoring number of launched containers)

 

docker run -e HOSTNAME='nux5.priv.practiceinsight' -e EMAIL='paul.igumnov@practiceinsight.io,sumit.patel@practiceinsight.io,michael.fleuchaus@practiceinsight.io' \
           -e CONTAINER_NUMBER='5' -d -v /var/run/docker.sock:/var/run/docker.sock  -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro \
           --restart=always --pid=host --name service practiceinsight/dms_service:1.3-zc

 

This image contains 4 scripts: restart, cleanup, availability monitor and health check. Details here.

Migration details

  1. Postgres data fodler is not compatible with the old one, so you need to make backup/restore to the new container.
  2. Elasticsearch folder path is not the same as for previous version, you will need to mount internal folder of cluster data: old container has /storage/elastic/ mounted, for the new one /storage/elastic/elasticsearch must be mounted.
  3. Nuxeo data folder must be chowned to 1000:1000
  4. Be sure to have the data backup.
  • No labels