2019-08-20 17:19:15 +02:00
|
|
|
# Clone git repository form specified tag
|
|
|
|
FROM alpine/git
|
|
|
|
|
|
|
|
ARG GIT_TAG
|
|
|
|
|
|
|
|
WORKDIR /sebserver
|
2019-08-26 16:54:23 +02:00
|
|
|
RUN if [ "x${GIT_TAG}" = "x" ] ; \
|
2019-08-20 17:19:15 +02:00
|
|
|
then git clone --depth 1 https://github.com/SafeExamBrowser/seb-server.git ; \
|
|
|
|
else git clone -b "$GIT_TAG" --depth 1 https://github.com/SafeExamBrowser/seb-server.git ; fi
|
|
|
|
|
|
|
|
# Build with maven (skip tests)
|
|
|
|
FROM maven:latest
|
|
|
|
|
|
|
|
ARG SEBSERVER_VERSION
|
|
|
|
|
|
|
|
WORKDIR /sebserver
|
|
|
|
COPY --from=0 /sebserver/seb-server /sebserver
|
|
|
|
RUN mvn clean install -DskipTests
|
|
|
|
|
|
|
|
FROM openjdk:11-jre-stretch
|
|
|
|
|
|
|
|
ARG SEBSERVER_VERSION
|
|
|
|
|
|
|
|
WORKDIR /sebserver
|
|
|
|
COPY --from=1 /sebserver/target/seb-server-"$SEBSERVER_VERSION".jar /sebserver
|
|
|
|
|
2019-08-21 09:53:29 +02:00
|
|
|
ARG SEBSERVER_VERSION
|
|
|
|
ENV SEBSERVER_VERSION=${SEBSERVER_VERSION}
|
2019-08-27 09:13:33 +02:00
|
|
|
|
|
|
|
ENTRYPOINT exec java -jar seb-server-"${SEBSERVER_VERSION}".jar --spring.config.location=classpath:/config/,file:.
|
2019-08-21 09:53:29 +02:00
|
|
|
|
2019-08-20 17:19:15 +02:00
|
|
|
EXPOSE $PORT
|