Skip to content

Commit

Permalink
Added Docker configuration files and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinke Hoekstra committed May 19, 2017
1 parent 517b749 commit c6ea162
Show file tree
Hide file tree
Showing 10 changed files with 273 additions and 115 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
18 changes: 18 additions & 0 deletions Dockerfile.guidelines
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:2.7.13-wheezy

MAINTAINER [email protected]

ENV GUIDELINES_APP="/usr/local/guidelines"

COPY ./requirements.txt /requirements.txt
RUN pip install -r requirements.txt

COPY ./src ${GUIDELINES_APP}

COPY entrypoint.sh /sbin/entrypoint.sh
RUN chmod 755 /sbin/entrypoint.sh

WORKDIR ${GUIDELINES_APP}
ENTRYPOINT ["/sbin/entrypoint.sh"]
CMD ["app:start"]
EXPOSE 5000
37 changes: 37 additions & 0 deletions Dockerfile.stardog
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM java:8-jre-alpine

ENV STARDOG_VERSION 4.1.2

ENV STARDOG_HOME /data
ENV STARDOG_INSTALL_DIR /opt/stardog

ENV STARDOG_START_PARAMS ""
ENV STARDOG_DB_NAME guidelines
ENV STARDOG_CREATE_PARAMS "-n ${STARDOG_DB_NAME} -v -o versioning.enabled=true preserve.bnode.ids=false strict.parsing=false --"
ENV STARDOG_JAVA_ARGS "-Xms2g -Xmx2g -XX:MaxDirectMemorySize=2g"
ENV PATH ${STARDOG_INSTALL_DIR}/bin:${PATH}

RUN mkdir -p ${STARDOG_HOME}
RUN mkdir -p ${STARDOG_INSTALL_DIR}

WORKDIR ${STARDOG_INSTALL_DIR}

RUN apk update
RUN apk add unzip bash

ADD stardog-*.zip /tmp
RUN unzip -d /tmp /tmp/stardog-*.zip
RUN rm -f /tmp/stardog-*.zip
RUN cp -r /tmp/stardog-*/* ${STARDOG_INSTALL_DIR}/
RUN rm -rf /tmp/stardog-*

ADD stardog-license-key.bin ${STARDOG_INSTALL_DIR}
ADD stardog.properties ${STARDOG_INSTALL_DIR}
ADD start-stardog-service.sh ${STARDOG_INSTALL_DIR}
RUN chmod +x ${STARDOG_INSTALL_DIR}/start-stardog-service.sh

WORKDIR ${STARDOG_HOME}

CMD ${STARDOG_INSTALL_DIR}/start-stardog-service.sh

EXPOSE 5820
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3'
services:
guidelines:
build:
context: .
dockerfile: Dockerfile.guidelines
ports:
- "127.0.0.1:5000:5000"
environment:
- ENDPOINT_URL=http://stardog:5820/guidelines/query
- UPDATE_URL=http://stardog:5820/guidelines/update
stardog:
build:
context: .
dockerfile: Dockerfile.stardog
environment:
- STARDOG_START_PARAMS=--disable-security
volumes:
- ./src/data/:/var/data
ports:
- "127.0.0.1:5820:5820"
21 changes: 21 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -e #exit on errors

#print statements as they are executed
[[ -n $DEBUG_ENTRYPOINT ]] && set -x

case ${1} in
app:start)
python run.py
;;
app:help)
echo "Available options:"
echo " app:start - Starts TMR4i Guidelines Explorer (default)"
echo " [command] - Execute the specified command, eg. /bin/bash."
;;
*)
exec "$@"
;;
esac

exit 0
30 changes: 27 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
# Guidelines Demo

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
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.

## Setup
This repository also contains the `metis` application that runs with Swish. You can find a separate readme file in that directory.

## Setup (using Docker)

* Make sure you have docker installed on your system (<http://docker.com>)
* Open up a terminal window and clone or download this repository to a location of your choice:

```
git clone https://github.com/Data2Semantics/guidelines.git
```
* Change into the `guidelines` directory
* Download the latest version of Stardog from <https://stardog.com>
* Copy the zipfile for the latest version of Stardog into this directory (e.g. `stardog-5.0-beta.zip`).
* Also copy the `stardog-license-key.bin` file into this directory
* From the command line run `docker-compose build` to create the Docker images

### Starting (using Docker)

* Change into the `guidelines` directory and run `docker-compose up`
* Go to `http://localhost:5000` and have fun!

## Setup (from source)

* Make sure you have `pip` and `virtualenv` installed (`easy_install pip`, `pip install virtualenv`)
* Go to the directory in which you cloned this Git repository, and install a virtual environment: `virtualenv .`
* Activate the virtual environment: `source bin/activate`
* Install the required packages: `pip install -r requirements.txt`
* Make sure you have a properly installed Stardog server running, with **security disabled** (`stardog-admin server start --disable-security`)
* Go to the `src` directory, and run `create-stardog.sh` and then `reset-stardog.sh`

### Starting (from source)

* Inside the `src` directory, run `python run.py`
* Go to `http://localhost:5000` and have fun!
* Go to `http://localhost:5000` and have fun!
Loading

0 comments on commit c6ea162

Please sign in to comment.