Before running through this guide, please make sure docker has been installed on the machine.
Login to Docker Hub
In order to be able to pull Docker images, we need login to the official Docker Hub first by simply using the following command:
docker login
Pull DMS Docker images
DMS components have been packaged as three docker images:
- practiceinsight/dms_postgresql
- practiceinsight/dms_elasticsearch
- practiceinsight/dms_nuxeo_suite
To pull these images, please simply execute the commands below:
docker pull practiceinsight/dms_postgresql docker pull practiceinsight/dms_elasticsearch docker pull practiceinsight/dms_nuxeo_suite:1.9.2
Run DMS Docker containers
Common rules for all containers
- Be sure, that user that launches docker container has write permissions on the mounting folders.
- The version of the Linux kernel version for Ubuntu host machine must be 3.16 or higher (Lower versions contain bug that causes impossibility to use 'su' command in container with '–net=host' option enabled)
If you want to restart docker containers on boot or in case of failure, you should add "–restart=always" option to the run command of container. The container will not be restarted if it's stopped with "docker kill/stop" command. Here is the example for elasticsearch:
docker run -p 9200:9200 -p 9300:9300 \ --restart=always \ -v /local_elasticsearch_data_folder:/data \ --net=host \ --name elastic -d practiceinsight/dms_elasticsearch
If you want to start Nuxeo container on boot then you need to add this option to elasticsearch and postgres containers also.
- On Windows mounting folders must be located in C:/Users, on Mac OS X - in /Users
When you are starting the container on Windows, folder must be mounted that way (two slashes are needed for the windows path):
-v //c/users/:/path_in_container
If you operate docker on Windows with Docker Quickstart Terminal, then execution of the docker exec commands on windows must be done in the docker machine command line. if the docker machine is called "default", then you can get access to it with:
docker-machine ssh default
If you operate docker with PowerShell then this step is unnecessary.
Run DMS PostgreSQL container on Windows or Mac OS X
Requirements to run:
- PostgreSQL backup folder must be mounted.
- Port 5432 must be exposed.
Example command:
docker run -p 5432:5432 -v /backup_folder_on_host:/backup --net=host --name postgres -d practiceinsight/dms_postgresql_winmac
If you have an running PostgreSQL database which needs to be migrated to the PostgreSQL container, the best way is to export the data first and then import to the PostgreSQL database running with the Docker container. You can mount the existing folder with PostgreSQL 9.3 database, but be sure to have backup, because the owner and permissions of these files will be changed and the data can be changed.
To export the original Nuxeo PostgreSQL database, please use the following commands (please change parameters as needed):
pg_dump --host localhost --port 5432 --username nuxeo --format custom --file "nuxeo-postgresql-db-20150916.bak" nuxeo
This command will ask for the password of the Nuxeo database, so please prepare that in advance.
After that, we need to copy the backup file to the backup folder on host machine:
Then you need to execute the next docker command:
docker exec -it postgres pg_restore --dbname=postgresql://nuxeo:nuxeop@127.0.0.1:5432/nuxeo /backup/nuxeo-postgresql-db-20150916.bak
To backup the database from the container, you need to execute:
docker exec -it postgres pg_dump --dbname=postgresql://nuxeo:nuxeop@127.0.0.1:5432/nuxeo -Fc --file "/backup/nuxeo-postgresql.bak"
There is also automatic backup script that is disabled by default, to enable it you need to execute the next command:
docker exec -it postgres chmod +x /etc/services/backup/run
After script enabling it will start to make the backup copies of the nuxeo database to the backup folder every hour.
If you want to change the parameters if the backup script (such as backup format, password, time delay between backups), you can easily do it with the next command:
docker exec -it postgres vim /etc/services/backup/run
To stop the automatic backups you just need to:
docker exec -it postgres chmod -x /etc/services/backup/run
Run DMS PostgreSQL container on Linux
DMS Postgresql for Linux is a container that is similar to a WinMac one, but all the data files of the postgresql are located in the folder of host machine. All the scripts for the WinMac container are working here.
Requirements to run:
- PostgreSQL data folder must be mounted. Be sure, that user that launches docker container has write permissions on this folder. This folder should contain a valid data of Postgresql 9.3, it also can be empty, then new nuxeo database will be created there. If you have older version of Postgresql, then you need to backup/restore it with scripts of WinMac.
- Port 5432 must be exposed.
- If you want to backup and restore database with the WinMac scripts, then the backup volume must be mounted with -v /backup_folder_on_host:/backup
Example command:
docker run -p 5432:5432 \ -v /local_postgres_data_folder:/var/db/postgres/data \ --net=host \ --name postgres -d practiceinsight/dms_postgresql
Run DMS ElasticSearch container
Requirements to run:
- ElasticSearch data folder must be mounted. Be sure, that user that launches docker container has write permissions on this folder. Can be empty.
- Ports 9200 and 9300 must be exposed.
Example command:
docker run -p 9200:9200 -p 9300:9300 \ -v /local_elasticsearch_data_folder:/data \ --net=host \ --name elastic -d practiceinsight/dms_elasticsearch
Run DMS Nuxeo suite container
Requirements to run:
- Ports 8080 and 9080 must be exposed.
- Nuxeo data folder must be mounted. Be sure, that user that launches docker container has write permissions on this folder. Can be empty.
- Folder containing pi-nuxeo.xml and nuxeo.conf must be mounted. nuxeo.conf.template will be added here on the first container launch.
The following parameters must be set in the nuxeo.conf:
Key | Sample value | Description |
---|---|---|
nuxeo | Nuxeo database name | |
nuxeo.db.user | nuxeo | Nuxeo database username |
nuxeo.db.host | 127.0.0.1 | Nuxeo database hostname or ip |
localhost (if postgres container is linked) | ||
db.yourserver.com | ||
nuxeo.db.port | 5432 | Nuxeo database port |
nuxeo.db.password | nuxeop | Nuxeo database password |
elasticsearch.addressList | 127.0.0.1:9300 | Elasticsearch server hostname or ip with port |
localhost:9300 (if elasticsearch container is linked) | ||
es.yourserver.com:9300 | ||
elasticsearch.clusterName | elasticsearch | Name of elasticsearch cluster used for the Nuxeo |
elasticsearch.indexName | nuxeo | Name of elasticsearch Nuxeo index |
elasticsearch.indexNumberOfShards | 5 (is default value in elasticsearch) | Number of elasticsearch shards used for the Nuxeo index |
elasticsearch.indexNumberOfReplicas | 0 | Number of elasticsearch replicas used for the Nuxeo index |
patricia.db.jdbcDriver | com.microsoft.sqlserver.jdbc.SQLServerDriver | JDBC driver to be used (must be embedded to the pi-nuxeo-marketplace) |
patricia.db.jdbcUrl | jdbc:sqlserver://192.168.3.99:1433; databaseName=patricia_GHF_demo; integratedSecurity=false (remove line breaks) | JDBC connection URL (the structure depends on driver) |
patricia.db.username | patricia | Patricia database username |
patricia.db.password | password | Patricia database password |
nuxeo.wizard.done | true | Flag that shows that nuxeo is already configured and no need to launch configuration wizard on the first launch |
Also be sure that Nuxeo installation id is set in the pat_configuration table of Patricia DB.
Example command to run Nuxeo container:
docker run -p 8080:8080 -p 9080:9080 \ -v /local_nuxeo_data_folder:/var/lib/nuxeo/data \ -v /local_config_folder:/etc/nuxeo \ --net=host \ --name nuxeo practiceinsight/dms_nuxeo_suite:1.9.2
If you want to use your own fonts in nuxeo, then you should add the next option to the run command:
-v /local_fonts_folder:/usr/share/fonts/custom-fonts
Once all three containers are up and running, you should be able to get access to the Nuxeo with PI marketplace installed via:
http://127.0.0.1:8080/nuxeo
and to the casebrowser via:
http://127.0.0.1:9080/casebrowser