Skip to content

Commit

Permalink
fix handling of multiple instances. change dl urls
Browse files Browse the repository at this point in the history
- reset was only working for the first instance
- starting was only working if root folder names
  were different
=> fix by assigning project names based of start
   port

- changed CODH URLs to 'latest' scheme where
  possible
  • Loading branch information
IllDepence committed Aug 18, 2018
1 parent 8500e54 commit 89131f5
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ cf/authFirebase.js
cm/authFirebase.js
ce/authFirebase.js
docker-compose.yml
proj_name
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Docker setup for running all parts of the [IIIF Curation Platform](http://codh.r
* place a modified `authFirebase.js` in cv/, cf/, cm/ and ce/
* add the host part of `externalurl` to the authorized domains in your Firebase console
* `$ ./setup.sh`
* `$ docker-compose up --build`
* `$ ./start.sh`

### General use

Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ version: '2'
services:
jsonkeeper:
build: ./JSONkeeper
labels:
- 'curation_platform_strtport'
ports:
- 'jkport:8000'
volumes:
- ./JSONkeeper/config.ini:/jsonkeeper/config.ini

canvasindexer:
build: ./Canvas-Indexer
labels:
- 'curation_platform_strtport'
ports:
- 'ciport:8000'
volumes:
Expand All @@ -18,26 +22,36 @@ services:

curationfinder:
build: ./IIIFCurationFinder
labels:
- 'curation_platform_strtport'
ports:
- 'cfport:80'

curationviewer:
build: ./IIIFCurationViewer
labels:
- 'curation_platform_strtport'
ports:
- 'cvport:80'

curationmanager:
build: ./IIIFCurationManager
labels:
- 'curation_platform_strtport'
ports:
- 'cmport:80'

curationeditor:
build: ./IIIFCurationEditor
labels:
- 'curation_platform_strtport'
ports:
- 'ceport:80'

loris:
image: 'lorisimageserver/loris'
labels:
- 'curation_platform_strtport'
ports:
- 'lport:5004'
volumes:
Expand Down
21 changes: 1 addition & 20 deletions reset.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
#!/bin/bash

cic=`docker ps -a -q -f name=curationframeworkbackend_canvasindexer_1`
jkc=`docker ps -a -q -f name=curationframeworkbackend_jsonkeeper_1`
cvc=`docker ps -a -q -f name=curationframeworkbackend_curationviewer_1`
cfc=`docker ps -a -q -f name=curationframeworkbackend_curationfinder_1`
lc=`docker ps -a -q -f name=curationframeworkbackend_loris_1`
if [ ! -z "$cic" -a "$cic" != "" ]; then
docker container rm "$cic"
fi
if [ ! -z "$jkc" -a "$jkc" != "" ]; then
docker container rm "$jkc"
fi
if [ ! -z "$cvc" -a "$cvc" != "" ]; then
docker container rm "$cvc"
fi
if [ ! -z "$cfc" -a "$cfc" != "" ]; then
docker container rm "$cfc"
fi
if [ ! -z "$lc" -a "$lc" != "" ]; then
docker container rm "$lc"
fi
docker container prune -f --filter=label=`cat ./proj_name`
11 changes: 7 additions & 4 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

# Configurate the external URL (without trailing slash) and start port number here
# externalurl=http://136.187.82.133/cp
externalurl=http://192.168.0.10/cp
externalurl=http://192.168.0.158/cp

start_port=9001

jk_git_url="https://github.com/IllDepence/JSONkeeper.git"
ci_git_url="https://github.com/IllDepence/Canvas-Indexer.git"
cv_zip_url="http://codh.rois.ac.jp/software/download/IIIFCurationViewer_20180710.zip"
cv_zip_url="http://codh.rois.ac.jp/software/download/IIIFCurationViewer_latest.zip"
cf_zip_url="http://codh.rois.ac.jp/software/download/IIIFCurationFinder_20180710.zip"
cm_zip_url="http://codh.rois.ac.jp/software/download/IIIFCurationManager_20180712.zip"
ce_zip_url="http://codh.rois.ac.jp/software/download/IIIFCurationEditor_20180712.zip"
cm_zip_url="http://codh.rois.ac.jp/software/download/IIIFCurationManager_latest.zip"
ce_zip_url="http://codh.rois.ac.jp/software/download/IIIFCurationEditor_latest.zip"

# NOTE: services are expected to be accessible at
# - JSONkeeper: <externalurl>/curation/
Expand Down Expand Up @@ -104,6 +104,7 @@ sed -i -E "s/jsonKeeperEditorUrl: '.+'/jsonKeeperEditorUrl: '$exturlesc\/editor\

# - - - - - Docker Compose - - - - -
cp docker-compose.yml.dist docker-compose.yml
sed -i -E "s/strtport/$start_port/" docker-compose.yml
sed -i -E "s/jkport/$((start_port + 0))/" docker-compose.yml
sed -i -E "s/ciport/$((start_port + 1))/" docker-compose.yml
sed -i -E "s/cvport/$((start_port + 2))/" docker-compose.yml
Expand All @@ -112,4 +113,6 @@ sed -i -E "s/cmport/$((start_port + 4))/" docker-compose.yml
sed -i -E "s/ceport/$((start_port + 5))/" docker-compose.yml
sed -i -E "s/lport/$((start_port + 6))/" docker-compose.yml

echo -n "curation_platform_$start_port" > proj_name

./reset.sh
3 changes: 3 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker-compose --project-name `cat ./proj_name` up --build

0 comments on commit 89131f5

Please sign in to comment.