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)
...
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 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
...
Code Block |
---|
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):
...
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=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:
- 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,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 \ --restart=always --pid=host --name service practiceinsight/dms_service:new1.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.