Skip to content

Commit

Permalink
upgrade JTango; add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingvord committed May 31, 2021
1 parent 19a4f88 commit 2d6e4e0
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM adoptopenjdk/openjdk11:alpine-jre

#TODO build libpniio

RUN apk add dumb-init
MAINTAINER [email protected]

ARG JAR_FILE
ADD target/${JAR_FILE} /app/bin/dfs.jar

ADD etc /app/etc

RUN addgroup --system javauser && adduser -S -s /bin/false -G javauser javauser
RUN chown -R javauser /app

USER javauser

WORKDIR /app

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD java -jar -server -DTANGO_HOST=$TANGO_HOST /app/bin/dfs.jar dev
53 changes: 51 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<properties>
<github.organization>hzg-wpi</github.organization>
<github.repo>data-format-server</github.repo>
<dockerhub.username>hzhereon</dockerhub.username>
<dockerhub.repo>data-format-server</dockerhub.repo>
<jtango.ver>1.0.5</jtango.ver>
</properties>

<scm>
Expand Down Expand Up @@ -89,6 +92,29 @@
<releaseProfiles>release</releaseProfiles>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.12</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
<configuration>
<repository>registry.hub.docker.com/${dockerhub.username}/${dockerhub.repo}</repository>
<tag>latest</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
</configuration>
</plugin>
</plugins>
</build>

Expand All @@ -112,7 +138,7 @@
<dependency>
<groupId>de.hereon.tango</groupId>
<artifactId>ez</artifactId>
<version>1.0.4</version>
<version>${jtango.ver}</version>
</dependency>
<dependency>
<groupId>de.hereon</groupId>
Expand All @@ -122,7 +148,7 @@
<dependency>
<groupId>de.hereon.tango</groupId>
<artifactId>server</artifactId>
<version>1.0.4</version>
<version>${jtango.ver}</version>
</dependency>
</dependencies>

Expand All @@ -131,6 +157,29 @@
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.12</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
<configuration>
<repository>registry.hub.docker.com/${dockerhub.username}/${dockerhub.repo}</repository>
<tag>${project.version}</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
</configuration>
</plugin>
<plugin>
<groupId>de.jutzig</groupId>
<artifactId>github-release-plugin</artifactId>
Expand Down
3 changes: 3 additions & 0 deletions register.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CID=`docker ps -aqf "name=tango-cs"`
echo $CID
docker exec $CID /usr/local/bin/tango_admin --add-server DataFormatServer/dev DataFormatServer dev/xenv/dfs

0 comments on commit 2d6e4e0

Please sign in to comment.