prepare demo with docker compose
This commit is contained in:
parent
ccc609a17b
commit
44f71c70c9
5 changed files with 78 additions and 23 deletions
|
@ -3,7 +3,9 @@ FROM alpine/git
|
||||||
ARG GIT_TAG
|
ARG GIT_TAG
|
||||||
|
|
||||||
WORKDIR /demo
|
WORKDIR /demo
|
||||||
RUN git clone -b "$GIT_TAG" --depth 1 https://github.com/SafeExamBrowser/seb-server.git
|
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
|
||||||
|
|
||||||
FROM maven:3.5-jdk-8-alpine
|
FROM maven:3.5-jdk-8-alpine
|
||||||
|
|
||||||
|
@ -16,13 +18,20 @@ RUN mvn clean install -e -P Demo -DskipTests
|
||||||
FROM openjdk:8-jre-alpine
|
FROM openjdk:8-jre-alpine
|
||||||
|
|
||||||
ARG SEBSERVER_VERSION
|
ARG SEBSERVER_VERSION
|
||||||
ENV SEBSERVER_VERSION ${SEBSERVER_VERSION}
|
ENV SEBSERVER_VERSION=${SEBSERVER_VERSION}
|
||||||
|
ENV SERVER_ADDRESS=0.0.0.0
|
||||||
|
ENV SERVER_PORT=8080
|
||||||
|
ENV DBSERVER_ADDRESS=seb-server-mariadb
|
||||||
|
ENV DBSERVER_PORT=3306
|
||||||
|
ENV DBSERVER_PWD=
|
||||||
|
ENV GUICLIENT_PWD=
|
||||||
|
ENV INTERNAL_PWD=
|
||||||
|
|
||||||
WORKDIR /demo
|
WORKDIR /demo
|
||||||
COPY --from=1 /demo/target/seb-server-"$SEBSERVER_VERSION".jar /demo
|
COPY --from=1 /demo/target/seb-server-"$SEBSERVER_VERSION".jar /demo
|
||||||
|
|
||||||
ENTRYPOINT ["sh", "-c"]
|
ENTRYPOINT ["sh", "-c"]
|
||||||
|
|
||||||
CMD ["java -jar seb-server-${SEBSERVER_VERSION}.jar --spring.config.location=classpath:/config/,file:/demo/externalResources/ --server.address=0.0.0.0 --spring.profiles.active=demo"]
|
CMD ["java -jar seb-server-${SEBSERVER_VERSION}.jar --server.address=${SERVER_ADDRESS} --server.port=${SERVER_PORT} --spring.config.location=classpath:/config/,file:/demo/externalResources/ --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}"]
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
41
docker/demo/docker-compose.yml
Normal file
41
docker/demo/docker-compose.yml
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
mariadb:
|
||||||
|
image: "mariadb/server:10.3"
|
||||||
|
container_name: seb-server-mariadb
|
||||||
|
volumes:
|
||||||
|
- seb-server-mariadb-data:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=[TO SET]
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
networks:
|
||||||
|
- ralph
|
||||||
|
|
||||||
|
seb-server:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
- GIT_TAG=
|
||||||
|
- SEBSERVER_VERSION=0.4.0-SNAPSHOT
|
||||||
|
container_name: seb-server
|
||||||
|
environment:
|
||||||
|
- SERVER_ADDRESS=0.0.0.0
|
||||||
|
- SERVER_PORT=8080
|
||||||
|
- DBSERVER_ADDRESS=seb-server-mariadb
|
||||||
|
- DBSERVER_PORT=3306
|
||||||
|
- ENV DBSERVER_PWD=[TO SET]
|
||||||
|
- ENV GUICLIENT_PWD=[TO SET]
|
||||||
|
- ENV INTERNAL_PWD=[TO SET]
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
networks:
|
||||||
|
- ralph
|
||||||
|
depends_on:
|
||||||
|
- "mariadb"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
ralph:
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
seb-server-mariadb-data:
|
|
@ -24,25 +24,29 @@ ARG SEBSERVER_VERSION
|
||||||
WORKDIR /sebserver
|
WORKDIR /sebserver
|
||||||
COPY --from=1 /sebserver/target/seb-server-"$SEBSERVER_VERSION".jar /sebserver
|
COPY --from=1 /sebserver/target/seb-server-"$SEBSERVER_VERSION".jar /sebserver
|
||||||
|
|
||||||
ENTRYPOINT ["sh", "-c"]
|
ARG SEBSERVER_VERSION
|
||||||
|
ENV SEBSERVER_VERSION=${SEBSERVER_VERSION}
|
||||||
ENV SERVER_ADDRESS=0.0.0.0
|
ENV SERVER_ADDRESS=0.0.0.0
|
||||||
ENV SERVER_PORT=80
|
ENV SERVER_PORT=80
|
||||||
ENV DBSERVER_ADDRESS=localhost
|
ENV DBSERVER_ADDRESS=localhost
|
||||||
ENV DBSERVER_PORT=3306
|
ENV DBSERVER_PORT=3306
|
||||||
ENV KEYSTORE_PWD=
|
ENV KEYSTORE_PWD=
|
||||||
|
|
||||||
CMD java \
|
ENTRYPOINT ["sh", "-c"]
|
||||||
-Dfile.encoding=UTF-8 \
|
|
||||||
-Djavax.net.ssl.keyStore=seb-server-keystore.pkcs12 \
|
CMD ["java -jar seb-server-${SEBSERVER_VERSION}.jar --spring.config.location=classpath:/config/,file:/sebserver/ --server.address=${SERVER_ADDRESS} --spring.profiles.active=dev"]
|
||||||
-Djavax.net.ssl.keyStorePassword="${KEYSTORE_PWD}" \
|
|
||||||
-Djavax.net.ssl.trustStore=seb-server-truststore.pkcs12 \
|
# CMD java \
|
||||||
-Djavax.net.ssl.trustStorePassword="${KEYSTORE_PWD}" \
|
# -Dfile.encoding=UTF-8 \
|
||||||
-jar seb-server-"${SEBSERVER_VERSION}".jar \
|
# -Djavax.net.ssl.keyStore=seb-server-keystore.pkcs12 \
|
||||||
--spring.config.location=classpath:/config/,file:/sebserver/ \
|
# -Djavax.net.ssl.keyStorePassword="${KEYSTORE_PWD}" \
|
||||||
--server.address="${SERVER_ADDRESS}" \
|
# -Djavax.net.ssl.trustStore=seb-server-truststore.pkcs12 \
|
||||||
--spring.profiles.active=dev \
|
# -Djavax.net.ssl.trustStorePassword="${KEYSTORE_PWD}" \
|
||||||
--datastore.mariadb.server.address="${DBSERVER_ADDRESS}" \
|
# -jar seb-server-"${SEBSERVER_VERSION}".jar \
|
||||||
--datastore.mariadb.server.port="${DBSERVER_PORT}"
|
# --spring.config.location=classpath:/config/,file:/sebserver/ \
|
||||||
|
# --server.address="${SERVER_ADDRESS}" \
|
||||||
|
# --spring.profiles.active=dev \
|
||||||
|
# --datastore.mariadb.server.address="${DBSERVER_ADDRESS}" \
|
||||||
|
# --datastore.mariadb.server.port="${DBSERVER_PORT}"
|
||||||
|
|
||||||
EXPOSE $PORT
|
EXPOSE $PORT
|
|
@ -18,7 +18,7 @@ services:
|
||||||
- ./certs:/etc/mysql/certs
|
- ./certs:/etc/mysql/certs
|
||||||
- seb-server-mariadb-data:/var/lib/mysql
|
- seb-server-mariadb-data:/var/lib/mysql
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=[TO SET]
|
- MYSQL_ROOT_PASSWORD=somePW
|
||||||
ports:
|
ports:
|
||||||
- 3306:3306
|
- 3306:3306
|
||||||
networks:
|
networks:
|
||||||
|
@ -34,11 +34,11 @@ services:
|
||||||
- SEBSERVER_VERSION=0.4.0-SNAPSHOT
|
- SEBSERVER_VERSION=0.4.0-SNAPSHOT
|
||||||
container_name: seb-server
|
container_name: seb-server
|
||||||
environment:
|
environment:
|
||||||
- SERVER_ADDRESS
|
- SERVER_ADDRESS=0.0.0.0
|
||||||
- SERVER_PORT
|
- SERVER_PORT=80
|
||||||
- DBSERVER_ADDRESS
|
- DBSERVER_ADDRESS=localhost
|
||||||
- DBSERVER_PORT
|
- DBSERVER_PORT=3306
|
||||||
- KEYSTORE_PWD=[TO SET]
|
- KEYSTORE_PWD=somePW
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
networks:
|
networks:
|
||||||
|
|
|
@ -10,6 +10,7 @@ datastore.mariadb.server.address=seb-server-mariadb
|
||||||
datastore.mariadb.server.port=3306
|
datastore.mariadb.server.port=3306
|
||||||
|
|
||||||
# data source configuration
|
# data source configuration
|
||||||
|
spring.datasource.username=root
|
||||||
spring.datasource.initialize=true
|
spring.datasource.initialize=true
|
||||||
spring.datasource.initialization-mode=always
|
spring.datasource.initialization-mode=always
|
||||||
spring.datasource.url=jdbc:mariadb://${datastore.mariadb.server.address}:${datastore.mariadb.server.port}/SEBServer?useSSL=false&createDatabaseIfNotExist=true
|
spring.datasource.url=jdbc:mariadb://${datastore.mariadb.server.address}:${datastore.mariadb.server.port}/SEBServer?useSSL=false&createDatabaseIfNotExist=true
|
||||||
|
|
Loading…
Reference in a new issue