Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ dist
/conf/split
/data
/conf/agrovoc_2016-07-15_lod.nt
/docker/svc
2 changes: 1 addition & 1 deletion .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Generated by sbteclipse
#Tue May 09 14:00:29 CEST 2017
#Tue Sep 17 12:53:28 CEST 2019
encoding/<project>=UTF-8
2 changes: 1 addition & 1 deletion .settings/org.scala-ide.sdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by sbteclipse
#Tue May 09 14:00:29 CEST 2017
#Tue Sep 17 12:53:28 CEST 2019
scala.compiler.additionalParams=-encoding utf8
deprecation=true
unchecked=true
Expand Down
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
language: java
jdk: oraclejdk8

jdk: openjdk8
env:
- ACTIVATOR_VERSION=1.3.9
jdk: oraclejdk8
before_script:
- wget http://downloads.typesafe.com/typesafe-activator/${ACTIVATOR_VERSION}/typesafe-activator-${ACTIVATOR_VERSION}-minimal.zip
- unzip typesafe-activator-${ACTIVATOR_VERSION}-minimal.zip
Expand Down
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,37 @@ A webservice to lookup SKOS concepts from an elasticsearch index.

# Usage

## Java 8
## Docker Run
### Git clone

cd /tmp
git clone https://github.com/hbz/skos-lookup
cd skos-lookup

### Docker

cd docker
bash docker-pre-build.sh

## Native Run

### Java 8

echo $JAVA_HOME //check if java 8 is configured

## Download Activator
### Download Activator

wget http://downloads.typesafe.com/typesafe-activator/1.3.2/typesafe-activator-1.3.2-minimal.zip
unzip typesafe-activator-1.3.2-minimal.zip
sudo mv activator-1.3.2-minimal /opt

## Git clone
### Git clone

cd /tmp
git clone https://github.com/hbz/skos-lookup
cd skos-lookup

## Run
### Run

# in order to support uploading larger skos files
export _JAVA_OPTIONS="-Xmx2g"
Expand Down
5 changes: 5 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM openjdk:8-jre-alpine
RUN apk update && apk add bash
COPY svc /svc
EXPOSE 9000 9000
CMD /svc/bin/start -Dhttp.port=9000
16 changes: 16 additions & 0 deletions docker/docker-pre-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/bash
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $scriptdir
cd ..
/opt/activator-1.3.2-minimal/activator dist

if [ -d docker/svc ]
then
rm -rf docker/svc
fi
unzip -d docker/svc target/universal/*-1.0-SNAPSHOT.zip && mv docker/svc/*/* docker/svc/ && rm docker/svc/bin/*.bat && mv docker/svc/bin/* docker/svc/bin/start

cd $scriptdir
docker volume create skos-lookup-data
docker build -t skos-lookup .
docker run -d --mount source=skos-lookup-data,target=/svc/data -p 9000:9000 --rm skos-lookup
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.8")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.10")

// Web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
Expand Down