Skip to content

Commit

Permalink
bind DS to localhost see ICIJ/datashare#144
Browse files Browse the repository at this point in the history
  • Loading branch information
bamthomas committed May 20, 2019
1 parent a4fcf1d commit 6e86bc6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion linux/datashare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mkdir -p ${MODELS_DIR}
DATA_DIR=${DATA_DIR:-${HOME}/Datashare}
mkdir -p ${DATA_DIR}
MEM_ALLOCATED_MEGA=$(free|awk '/^Mem:/{print $2"/(2*1024)"}'|bc)
BIND_HOST=127.0.0.1

if [ -z "${DS_JAVA_OPTS}" ] && [ -n "${MEM_ALLOCATED_MEGA}" ]; then
DS_JAVA_OPTS="-Xmx${MEM_ALLOCATED_MEGA}m"
Expand Down Expand Up @@ -50,6 +51,6 @@ if [ -n "${image_running}" ]; then
docker rm -f datashare > /dev/null
fi

docker run -p 8080:8080 --network datashare_default --name datashare --rm -e DS_JAVA_OPTS="${DS_JAVA_OPTS}" \
docker run -p $BIND_HOST:8080:8080 --network datashare_default --name datashare --rm -e DS_JAVA_OPTS="${DS_JAVA_OPTS}" \
-e DS_DOCKER_MOUNTED_DATA_DIR=${DATA_DIR} -v ${DATA_DIR}:/home/datashare/data:ro \
-v ${MODELS_DIR}:/home/datashare/dist -ti icij/datashare:${datashare_version} "$@"
4 changes: 1 addition & 3 deletions mac/datashare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
- "DS_JAVA_OPTS=\${DS_JAVA_OPTS}"
- "DS_DOCKER_MOUNTED_DATA_DIR=\${data_path}"
ports:
- "8080:8080"
- "127.0.0.1:8080:8080"
volumes:
- "\${dist_path}:/home/datashare/dist"
- "\${data_path}:/home/datashare/data:ro"
Expand All @@ -45,8 +45,6 @@ services:
- "http.cors.enabled=true"
- "http.cors.allow-origin=*"
- "http.cors.allow-methods=OPTIONS, HEAD, GET, POST, PUT, DELETE"
ports:
- "9200:9200"
EOF
}

Expand Down
6 changes: 1 addition & 5 deletions windows/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ services:
- "DS_JAVA_OPTS=\${DS_JAVA_OPTS}"
- "DS_DOCKER_MOUNTED_DATA_DIR=\${APPDATA}/Datashare/data"
ports:
- "8080:8080"
- "127.0.0.1:8080:8080"
volumes:
- "\${APPDATA}/Datashare/models:/home/datashare/dist"
- "\${APPDATA}/Datashare/data:/home/datashare/data:ro"

redis:
image: redis:4.0.1-alpine
restart: on-failure
ports:
- 6379:6379

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.3.0
Expand All @@ -32,5 +30,3 @@ services:
- "http.cors.enabled=true"
- "http.cors.allow-origin=*"
- "http.cors.allow-methods=OPTIONS, HEAD, GET, POST, PUT, DELETE"
ports:
- "9200:9200"

0 comments on commit 6e86bc6

Please sign in to comment.