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 | ||||
---|---|---|---|---|
| ||||
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 |
Build DMS PostgreSQL image
PostgreSQL is used by Nuxeo server, which is packaged in a separate Docker container. As the first step we need to build this PostgreSQL docker container.
For the build, next command must be executed from the folder with Dockerfile of PostgreSQL image.
Code Block |
---|
cd work/dms/prod/dms_postgresql
docker build -t asia.gcr.io/pi-devops/dms_postgresql:1.0 . |
Code Block |
---|
docker run -p 5432:5432 -v /home/nuxeo/docker/postgres_backup:/backup -v /home/nuxeo/docker/postgres_data:/var/lib/postgresql/data --restart=always --net=hostdms --name postgres -d asia.gcr.io/pi-devops/practiceinsight/dms_postgresql:12.0 |
Build DMS ElasticSearch image
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 imageOfficial one will be used
Run command:
Code Block |
---|
docker run -p 9200:9200 -p 9300:9300 -v /home/nuxeo/docker/elastic:/usr/share/elasticsearch/data --restart=always --name=elastic -d --net=dms elasticsearch:1.7.5 |
...
Start DMS Nuxeo
...
image
The image contains Nuxeo 7.3 with updated entrypoint. To build this image, please use the commands below:
Code Block |
---|
cd dms/base/nuxeo-7.3
docker build -t asia.gcr.io/pi-devops/nuxeo:7.3 . |
Build DMS Nuxeo base image
To build this image, please use the commands below:
Code Block |
---|
cd dms/base/dms_nuxeo_base
docker build -t asia.gcr.io/pi-devops/dms_nuxeo_base:1.0 . |
Build DMS Nuxeo image
This image is the actual production image which contains PI nuxeo module, nuxeo-dam and nuxeo-drive plugins deployed in it. This image can be connected to the PostgreSQL container and the ElasticSearch container when running. The version should match the version of pi-extended-dms release installed in the image.
To build this image, please run the commands below:
...
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):
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 | ||
---|---|---|
| ||
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:
Code Block | ||
---|---|---|
| ||
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:
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=hostdms --name nuxeo -d asia.gcr.io/pi-devops/practiceinsight/dms_nuxeo:1.9.67.2 |
...
Start DMS Casebrowser image
To build this image, please run the commands below:
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 |
Code Block |
cd dms/prod/dms_casebrowser docker build -t asia.gcr.io/pi-devops/dms_casebrowser:1.9.67.2 . |
Run command:
...
Start DMS service container
Requirements to run:
- Docker socket must be mounted to the container
- HOSTNAME variable must be provided (will be used in generated email messages)
- EMAIL variable must be provided (will be used in generated email messages as a list of recipients)
- 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,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
- Postgres data fodler is not compatible with the old one, so you need to make backup/restore to the new container.
- 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.
- Nuxeo data folder must be chowned to 1000:1000
- Be sure to have the data backup.