Skip to content

Commit c6ea162

Browse files
author
Rinke Hoekstra
committed
Added Docker configuration files and updated readme
1 parent 517b749 commit c6ea162

10 files changed

Lines changed: 273 additions & 115 deletions

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git

Dockerfile.guidelines

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM python:2.7.13-wheezy
2+
3+
MAINTAINER rinke.hoekstra@vu.nl
4+
5+
ENV GUIDELINES_APP="/usr/local/guidelines"
6+
7+
COPY ./requirements.txt /requirements.txt
8+
RUN pip install -r requirements.txt
9+
10+
COPY ./src ${GUIDELINES_APP}
11+
12+
COPY entrypoint.sh /sbin/entrypoint.sh
13+
RUN chmod 755 /sbin/entrypoint.sh
14+
15+
WORKDIR ${GUIDELINES_APP}
16+
ENTRYPOINT ["/sbin/entrypoint.sh"]
17+
CMD ["app:start"]
18+
EXPOSE 5000

Dockerfile.stardog

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM java:8-jre-alpine
2+
3+
ENV STARDOG_VERSION 4.1.2
4+
5+
ENV STARDOG_HOME /data
6+
ENV STARDOG_INSTALL_DIR /opt/stardog
7+
8+
ENV STARDOG_START_PARAMS ""
9+
ENV STARDOG_DB_NAME guidelines
10+
ENV STARDOG_CREATE_PARAMS "-n ${STARDOG_DB_NAME} -v -o versioning.enabled=true preserve.bnode.ids=false strict.parsing=false --"
11+
ENV STARDOG_JAVA_ARGS "-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g"
12+
ENV PATH ${STARDOG_INSTALL_DIR}/bin:${PATH}
13+
14+
RUN mkdir -p ${STARDOG_HOME}
15+
RUN mkdir -p ${STARDOG_INSTALL_DIR}
16+
17+
WORKDIR ${STARDOG_INSTALL_DIR}
18+
19+
RUN apk update
20+
RUN apk add unzip bash
21+
22+
ADD stardog-*.zip /tmp
23+
RUN unzip -d /tmp /tmp/stardog-*.zip
24+
RUN rm -f /tmp/stardog-*.zip
25+
RUN cp -r /tmp/stardog-*/* ${STARDOG_INSTALL_DIR}/
26+
RUN rm -rf /tmp/stardog-*
27+
28+
ADD stardog-license-key.bin ${STARDOG_INSTALL_DIR}
29+
ADD stardog.properties ${STARDOG_INSTALL_DIR}
30+
ADD start-stardog-service.sh ${STARDOG_INSTALL_DIR}
31+
RUN chmod +x ${STARDOG_INSTALL_DIR}/start-stardog-service.sh
32+
33+
WORKDIR ${STARDOG_HOME}
34+
35+
CMD ${STARDOG_INSTALL_DIR}/start-stardog-service.sh
36+
37+
EXPOSE 5820

docker-compose.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: '3'
2+
services:
3+
guidelines:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile.guidelines
7+
ports:
8+
- "127.0.0.1:5000:5000"
9+
environment:
10+
- ENDPOINT_URL=http://stardog:5820/guidelines/query
11+
- UPDATE_URL=http://stardog:5820/guidelines/update
12+
stardog:
13+
build:
14+
context: .
15+
dockerfile: Dockerfile.stardog
16+
environment:
17+
- STARDOG_START_PARAMS=--disable-security
18+
volumes:
19+
- ./src/data/:/var/data
20+
ports:
21+
- "127.0.0.1:5820:5820"

entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -e #exit on errors
3+
4+
#print statements as they are executed
5+
[[ -n $DEBUG_ENTRYPOINT ]] && set -x
6+
7+
case ${1} in
8+
app:start)
9+
python run.py
10+
;;
11+
app:help)
12+
echo "Available options:"
13+
echo " app:start - Starts TMR4i Guidelines Explorer (default)"
14+
echo " [command] - Execute the specified command, eg. /bin/bash."
15+
;;
16+
*)
17+
exec "$@"
18+
;;
19+
esac
20+
21+
exit 0

readme.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,38 @@
11
# Guidelines Demo
22

3-
This web application can show off the coolness of the TMR and TMR4I ontologies developed by Veruska Zamborlini in detecting interactions between the recommendations of medical guidelines
3+
This web application can show off the coolness of the TMR and TMR4I ontologies developed by Veruska Zamborlini in detecting interactions between the recommendations of medical guidelines.
44

5-
## Setup
5+
This repository also contains the `metis` application that runs with Swish. You can find a separate readme file in that directory.
6+
7+
## Setup (using Docker)
8+
9+
* Make sure you have docker installed on your system (<http://docker.com>)
10+
* Open up a terminal window and clone or download this repository to a location of your choice:
11+
12+
```
13+
git clone https://github.com/Data2Semantics/guidelines.git
14+
```
15+
* Change into the `guidelines` directory
16+
* Download the latest version of Stardog from <https://stardog.com>
17+
* Copy the zipfile for the latest version of Stardog into this directory (e.g. `stardog-5.0-beta.zip`).
18+
* Also copy the `stardog-license-key.bin` file into this directory
19+
* From the command line run `docker-compose build` to create the Docker images
20+
21+
### Starting (using Docker)
22+
23+
* Change into the `guidelines` directory and run `docker-compose up`
24+
* Go to `http://localhost:5000` and have fun!
25+
26+
## Setup (from source)
627

728
* Make sure you have `pip` and `virtualenv` installed (`easy_install pip`, `pip install virtualenv`)
829
* Go to the directory in which you cloned this Git repository, and install a virtual environment: `virtualenv .`
930
* Activate the virtual environment: `source bin/activate`
1031
* Install the required packages: `pip install -r requirements.txt`
1132
* Make sure you have a properly installed Stardog server running, with **security disabled** (`stardog-admin server start --disable-security`)
1233
* Go to the `src` directory, and run `create-stardog.sh` and then `reset-stardog.sh`
34+
35+
### Starting (from source)
36+
1337
* Inside the `src` directory, run `python run.py`
14-
* Go to `http://localhost:5000` and have fun!
38+
* Go to `http://localhost:5000` and have fun!

0 commit comments

Comments
 (0)