seb-server/docker/demo/Dockerfile

46 lines
1.5 KiB
Text
Raw Normal View History

2019-02-01 23:38:47 +01:00
FROM alpine/git
2019-08-12 12:05:29 +02:00
2019-08-23 13:21:59 +02:00
ARG GIT_TAG
2019-08-23 13:13:16 +02:00
ARG SEBSERVER_VERSION
2019-08-12 12:05:29 +02:00
2019-09-02 08:59:41 +02:00
WORKDIR /sebserver
2019-08-23 13:21:59 +02:00
RUN if [ "x${GIT_TAG}" = "x" ] ; \
2019-08-21 09:53:29 +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
2019-02-01 22:18:31 +01:00
2019-02-01 23:38:47 +01:00
FROM maven:3.5-jdk-8-alpine
2019-08-12 12:05:29 +02:00
2019-08-20 17:19:15 +02:00
ARG SEBSERVER_VERSION
2019-08-12 12:05:29 +02:00
2019-09-02 08:59:41 +02:00
WORKDIR /sebserver
COPY --from=0 /sebserver/seb-server /sebserver
2019-02-01 23:38:47 +01:00
RUN mvn clean install -e -P Demo -DskipTests
2019-02-01 22:18:31 +01:00
2019-02-01 23:38:47 +01:00
FROM openjdk:8-jre-alpine
2019-08-12 12:05:29 +02:00
2019-08-20 17:19:15 +02:00
ARG SEBSERVER_VERSION
2019-08-21 09:53:29 +02:00
ENV SEBSERVER_VERSION=${SEBSERVER_VERSION}
2019-08-21 11:48:34 +02:00
ENV SERVER_PORT="8080"
2019-09-02 08:59:41 +02:00
ENV DBSERVER_PWD=
ENV GUICLIENT_PWD=
ENV INTERNAL_PWD=
WORKDIR /sebserver
COPY --from=1 /sebserver/target/seb-server-"$SEBSERVER_VERSION"-SNAPSHOT.jar /sebserver
ENTRYPOINT exec java \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=9090 \
-Dcom.sun.management.jmxremote.rmi.port=9090 \
-Djava.rmi.server.hostname=127.0.0.1 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-jar seb-server-"${SEBSERVER_VERSION}"-SNAPSHOT.jar \
2019-08-26 16:54:23 +02:00
--server.port="${SERVER_PORT}" \
--spring.profiles.active=demo \
2019-09-02 08:59:41 +02:00
--spring.config.location=file:/sebserver/,classpath:/config/ \
2019-08-26 16:54:23 +02:00
--spring.datasource.password="${DBSERVER_PWD}" \
--sebserver.webservice.api.admin.clientSecret="${GUICLIENT_PWD}" \
--sebserver.webservice.internalSecret="${INTERNAL_PWD}"
2019-02-04 21:52:38 +01:00
2019-09-02 08:59:41 +02:00
EXPOSE $SERVER_PORT 9090