seb-server/docker/demo/Dockerfile

37 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
ARG GIT_TAG
2019-02-01 23:38:47 +01:00
WORKDIR /demo
2019-08-21 09:53:29 +02:00
RUN if [ "x$arg" = "x" ] ; \
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-20 17:19:15 +02:00
COPY --from=1 /demo/target/seb-server-"$SEBSERVER_VERSION".jar /demo
2019-02-04 21:52:38 +01:00
2019-02-01 23:38:47 +01:00
ENTRYPOINT ["sh", "-c"]
2019-02-04 21:52:38 +01:00
2019-08-23 11:22:57 +02:00
CMD ["java -jar seb-server-${SEBSERVER_VERSION}.jar --server.address=${SERVER_ADDRESS} --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