seb-server/docker/demo/Dockerfile

44 lines
1.3 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-02-01 23:38:47 +01:00
WORKDIR /demo
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-02-01 22:18:31 +01:00
WORKDIR /demo
2019-02-01 23:38:47 +01:00
COPY --from=0 /demo/seb-server /demo
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_ADDRESS="0.0.0.0"
ENV SERVER_PORT="8080"
ENV DBSERVER_ADDRESS="seb-server-mariadb"
ENV DBSERVER_PORT="3306"
ENV DBSERVER_PWD="[TO_SET]"
ENV GUICLIENT_PWD="[TO_SET]"
ENV INTERNAL_PWD="[TO_SET]"
2019-08-12 12:05:29 +02:00
2019-02-01 23:38:47 +01:00
WORKDIR /demo
2019-08-23 13:13:16 +02:00
COPY --from=1 /demo/target/seb-server-"$SEBSERVER_VERSION"-SNAPSHOT.jar /demo
2019-02-04 21:52:38 +01:00
2019-08-26 16:54:23 +02:00
ENTRYPOINT exec java -jar seb-server-"${SEBSERVER_VERSION}"-SNAPSHOT.jar \
--server.port="${SERVER_PORT}" \
--spring.config.location=classpath:/config/ \
--datastore.mariadb.server.address="${DBSERVER_ADDRESS}" \
--datastore.mariadb.server.port="${DBSERVER_PORT}" \
--spring.profiles.active=demo \
--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
EXPOSE 8080