diff --git a/docker/demo/Dockerfile b/docker/demo/Dockerfile index c3139d3f..a5eef690 100644 --- a/docker/demo/Dockerfile +++ b/docker/demo/Dockerfile @@ -31,8 +31,14 @@ ENV INTERNAL_PWD="[TO_SET]" WORKDIR /demo COPY --from=1 /demo/target/seb-server-"$SEBSERVER_VERSION"-SNAPSHOT.jar /demo -ENTRYPOINT ["sh", "-c"] - -CMD ["java -jar seb-server-${SEBSERVER_VERSION}-SNAPSHOT.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}"] +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}" EXPOSE 8080 \ No newline at end of file diff --git a/docker/prod/standalone/selfsigned/Dockerfile b/docker/prod/standalone/selfsigned/Dockerfile index fe955773..42f2132a 100644 --- a/docker/prod/standalone/selfsigned/Dockerfile +++ b/docker/prod/standalone/selfsigned/Dockerfile @@ -4,7 +4,7 @@ FROM alpine/git ARG GIT_TAG WORKDIR /sebserver -RUN if [ "x$arg" = "x" ] ; \ +RUN if [ "x${GIT_TAG}" = "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 @@ -30,11 +30,28 @@ ENV SERVER_ADDRESS=0.0.0.0 ENV SERVER_PORT=80 ENV DBSERVER_ADDRESS=localhost ENV DBSERVER_PORT=3306 +ENV DBSERVER_PWD= +ENV GUICLIENT_PWD= +ENV INTERNAL_PWD= ENV KEYSTORE_PWD= -ENTRYPOINT ["sh", "-c"] +ENTRYPOINT exec java \ + -Dfile.encoding=UTF-8 \ + -Djavax.net.ssl.keyStore=seb-server-keystore.pkcs12 \ + -Djavax.net.ssl.keyStorePassword="${KEYSTORE_PWD}" \ + -Djavax.net.ssl.trustStore=seb-server-truststore.pkcs12 \ + -Djavax.net.ssl.trustStorePassword="${KEYSTORE_PWD}" \ + -jar seb-server-"${SEBSERVER_VERSION}".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=prod \ + --spring.datasource.password="${DBSERVER_PWD}" \ + --sebserver.webservice.api.admin.clientSecret="${GUICLIENT_PWD}" \ + --sebserver.webservice.internalSecret="${INTERNAL_PWD}" -CMD ["java -jar seb-server-${SEBSERVER_VERSION}.jar --spring.config.location=classpath:/config/,file:/sebserver/ --server.address=${SERVER_ADDRESS} --spring.profiles.active=dev"] +#CMD ["java -jar seb-server-${SEBSERVER_VERSION}-SNAPSHOT.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}"] # CMD java \ # -Dfile.encoding=UTF-8 \ diff --git a/docker/prod/standalone/selfsigned/docker-compose.yml b/docker/prod/standalone/selfsigned/docker-compose.yml index 7cdc0e69..f3c1a7a9 100644 --- a/docker/prod/standalone/selfsigned/docker-compose.yml +++ b/docker/prod/standalone/selfsigned/docker-compose.yml @@ -30,14 +30,17 @@ services: build: context: . args: - - GIT_TAG=v0.4.0-beta - - SEBSERVER_VERSION=0.4.0-SNAPSHOT + - GIT_TAG= + - SEBSERVER_VERSION=0.4.1-beta-SNAPSHOT container_name: seb-server environment: - SERVER_ADDRESS=0.0.0.0 - SERVER_PORT=80 - - DBSERVER_ADDRESS=localhost + - DBSERVER_ADDRESS=seb-server-mariadb - DBSERVER_PORT=3306 + - DBSERVER_PWD=somePW + - GUICLIENT_PWD=somePW + - INTERNAL_PWD=somePW - KEYSTORE_PWD=somePW ports: - 80:80 diff --git a/src/main/resources/config/application-dev-ws.properties b/src/main/resources/config/application-dev-ws.properties index 220d38e9..7601db09 100644 --- a/src/main/resources/config/application-dev-ws.properties +++ b/src/main/resources/config/application-dev-ws.properties @@ -10,7 +10,10 @@ spring.datasource.initialization-mode=always spring.datasource.url=jdbc:mariadb://localhost:3306/SEBServer?createDatabaseIfNotExist=true&verifyServerCertificate=false&useSSL=false&requireSSL=false spring.datasource.driver-class-name=org.mariadb.jdbc.Driver spring.datasource.platform=dev -spring.datasource.hikari.max-lifetime=600000 +spring.datasource.hikari.initializationFailTimeout=30000 +spring.datasource.hikari.connectionTimeout=30000 +spring.datasource.hikari.idleTimeout=600000 +spring.datasource.hikari.maxLifetime=1800000 # webservice configuration sebserver.webservice.distributed=false diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index f5f4608b..0988d994 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -67,4 +67,13 @@ + + + + + + + + + \ No newline at end of file