Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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)

Code Block
languagebash
titleCreate 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:

Code Block
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 will be 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:

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

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)

...

Static part:

Code Block
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):

Code Block
titlenuxeo.conf
JAVA_OPTS=$JAVA_OPTS -Xms1024m -Xmx2048m

patricia.db.jdbcUrl=jdbc:sqlserver://10<sql.120server.5.51address>:1433;databaseName=patricia_demo_2<databasename>;integratedSecurity=false
patricia.db.username=sa<sa-account>
patricia.db.password=Skype#567<sa-pass>

 

For example, if If you want to use other override the default credentials for postgres , for example, you should from the static nuxeo.conf file, just add this option as additional options to your dynamic nuxeo.conf, so it will look that way:

Code Block
titlenuxeo.conf
JAVA_OPTS=$JAVA_OPTS -Xms1024m -Xmx2048m

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

Then docker just concatenates 2 parts together on container start.

 

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

In the run 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:

Code Block
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  data -v /home/nuxeo/docker/conf:/etc/nuxeo --restart=always --net=dms --name nuxeo -d practiceinsight/dms_nuxeo:1.9.7.12

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:

Code Block
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.12

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)

 

Code Block
docker run -e HOSTNAME='nux5.priv.practiceinsight' -e EMAIL='paul.igumnov@practiceinsight.io,sumit.patel@practiceinsight.io,Michaelmichael.Fleuchaus@practiceinsightfleuchaus@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 --pid=host --name service practiceinsight/dms_service:new
docker run -e HOSTNAME='nux5.priv.practiceinsight.io' -e EMAIL='paul.igumnov@practiceinsight.io,jake.wang@practiceinsight.io' -d -v /var/run/docker.sock:/var/run/docker.sock
 \
           --restart=always --pid=host --name service practiceinsight/dms_service:1.
2
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.