Page tree
Skip to end of metadata
Go to start of metadata

First of all, we will assume than you got the Core and/or IMS project, have installed an IDE and successfully imported the Core and/or IMS project.

 

One of the main interest of Docker is to have the same environment between developers and final users.

In order to do this and to avoid installation of a local machine, we must to have a Dockerized dev environment.

Before doing anything else, we will follow the two first points of an Automatic Installation with Docker (the points 3 and 4 will be used after the instructions of this page).

For Core & IMS development.

As IMS will run on your machine, you will need all the dependencies of IMS : tiffinfo, identify, vips. You can find into the Dockerfile of IMS the way to install these dependancies.

Then, in the Bootstrap folder, make the following changes :

1) In the nginx/deploy.sh file, replace the lines 

sed -i "s/CORE_ALIAS/core/g" /tmp/nginx.conf.sample
sed -i "s/IMS_ALIAS/ims/g" /tmp/nginx.conf.sample

# and
 
sed -i "s/IMS_URLS_CONFIG/                        proxy_pass http:\/\/ims:8080; \\`echo -e '\n\r'` IMS_URLS_CONFIG/g" /tmp/nginx.conf.sample

by

LOCAL=$(route -n | awk '/UG[ \t]/{print $2}')
sed -i "s/CORE_ALIAS/$LOCAL/g" /tmp/nginx.conf.sample
sed -i "s/IMS_ALIAS/$LOCAL:9080/g" /tmp/nginx.conf.sample

# and 

sed -i "s/IMS_URLS_CONFIG/                        proxy_pass http:\/\/$LOCAL:9080; \\`echo -e '\n\r'` IMS_URLS_CONFIG/g" /tmp/nginx.conf.sample


2) In the nginx/nginx.conf.sample, replace the line

proxy_pass   http://IMS_ALIAS:8080;

by

proxy_pass   http://IMS_ALIAS;

 

3) In the restart_keep_data.sh, replace the lines

#sh create_docker_images.sh
 
# and
 
sh start_deploy.sh

by

cd nginx && docker build -t="cytomine/nginxdev" .
cd ..
 
# and
 
sh start_dev.sh

 

6) In the clean_docker_keep_data.sh, add the lines

docker stop iipJ2
docker rm -v iipJ2

 

The last modifications need to be done in your IDE.And run the restart_keep_data.sh script.


Don't forget to add the local URLs to your /etc/hosts !

In the Config.groovy file into the Core project, update the value grails.serverURL (development part) by "http://CORE_URL:8080".

In the Config.groovy file into the Core and IMS project, update the public and private keys of admin, superAdmin, and ImageServer users. You can run the cat /proc/sys/kernel/random/uuid command to generate keys

In the DataSource.groovy file into the Core project, update the value username and password (development part) by "docker" and the url by "jdbc:postgresql://localhost:5432/docker".

In the Config.groovy file into the Core projectupdate the value grails.adminPassword by the default password of the admin user and add the retrievalUsername and retrievalPassword (default : cytomine and retrieval_default)


At the end, in IntelliJ, into the IMS project, edit the run configuration and change the Command Line by "-reloading -Dserver.port=9080 run-app -echoOut --stacktrace -nocoverage --verbose" before running the IMS project.
Into the Core, edit the run configuration and change the Command Line by "-reloading -Dserver.port=8080 run-app -echoOut --stacktrace -nocoverage --verbose" before running the Core project

 

You can now browse http://CORE_URL:8080 to test your dev environment.

  • No labels