diff --git a/Dockerfile b/Dockerfile index 77ce76d..763cc1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,8 @@ # Pull base image. FROM ubuntu:16.04 +ARG species=all + RUN apt-get -y update && apt-get install -y software-properties-common python-software-properties # Install Java. @@ -27,8 +29,12 @@ WORKDIR /data ADD owlsim-services/target/owlsim-services-3.0-SNAPSHOT.jar /data/ ADD configuration-samples/configuration-all.yaml /data/configuration.yaml -ADD http://ci.monarchinitiative.org/view/dev/job/create-owlsim-files-on-dev/lastSuccessfulBuild/artifact/server/all.owl /data/ -ADD https://raw.githubusercontent.com/monarch-initiative/monarch-owlsim-data/master/data/Homo_sapiens/Hs_disease_phenotype.txt /data/ +RUN if [ $species = "human" ]; \ + then \ + wget https://data.monarchinitiative.org/owl/all-hp.owl -O /data/all.owl; \ + else \ + wget http://ci.monarchinitiative.org/view/dev/job/create-owlsim-files-on-dev/lastSuccessfulBuild/artifact/server/all.owl -O /data/all.owl; \ + fi CMD java -jar /data/owlsim-services-3.0-SNAPSHOT.jar server /data/configuration.yaml diff --git a/README.md b/README.md index f80f5bd..7fd2ddc 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,18 @@ http://localhost:8080/api/match/jaccard?id=X:heart-morphology&id=X:brain-morphol ## Build with Docker -Run those commands from the root directory: +Run those commands from the root directory (with Docker >= 1.9): ``` mvn package -docker build -t owlsim . -docker run -p 8080:8080 owlsim +docker build -t owlsim-all . # by default contains all the species +docker run -p 8080:8080 owlsim-all +``` + +To restrict to specific species: + +``` +docker build --build-arg species=all -t owlsim-all . # default if no args is provided or not matching any species +docker build --build-arg species=human -t owlsim-human + ```