init production profile
This commit is contained in:
parent
a7097d8b81
commit
1d305c09d8
5 changed files with 48 additions and 10 deletions
|
@ -31,8 +31,14 @@ ENV INTERNAL_PWD="[TO_SET]"
|
||||||
WORKDIR /demo
|
WORKDIR /demo
|
||||||
COPY --from=1 /demo/target/seb-server-"$SEBSERVER_VERSION"-SNAPSHOT.jar /demo
|
COPY --from=1 /demo/target/seb-server-"$SEBSERVER_VERSION"-SNAPSHOT.jar /demo
|
||||||
|
|
||||||
ENTRYPOINT ["sh", "-c"]
|
ENTRYPOINT exec java -jar seb-server-"${SEBSERVER_VERSION}"-SNAPSHOT.jar \
|
||||||
|
--server.port="${SERVER_PORT}" \
|
||||||
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}"]
|
--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
|
EXPOSE 8080
|
|
@ -4,7 +4,7 @@ FROM alpine/git
|
||||||
ARG GIT_TAG
|
ARG GIT_TAG
|
||||||
|
|
||||||
WORKDIR /sebserver
|
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 ; \
|
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
|
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 SERVER_PORT=80
|
||||||
ENV DBSERVER_ADDRESS=localhost
|
ENV DBSERVER_ADDRESS=localhost
|
||||||
ENV DBSERVER_PORT=3306
|
ENV DBSERVER_PORT=3306
|
||||||
|
ENV DBSERVER_PWD=
|
||||||
|
ENV GUICLIENT_PWD=
|
||||||
|
ENV INTERNAL_PWD=
|
||||||
ENV KEYSTORE_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 \
|
# CMD java \
|
||||||
# -Dfile.encoding=UTF-8 \
|
# -Dfile.encoding=UTF-8 \
|
||||||
|
|
|
@ -30,14 +30,17 @@ services:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
args:
|
args:
|
||||||
- GIT_TAG=v0.4.0-beta
|
- GIT_TAG=
|
||||||
- SEBSERVER_VERSION=0.4.0-SNAPSHOT
|
- SEBSERVER_VERSION=0.4.1-beta-SNAPSHOT
|
||||||
container_name: seb-server
|
container_name: seb-server
|
||||||
environment:
|
environment:
|
||||||
- SERVER_ADDRESS=0.0.0.0
|
- SERVER_ADDRESS=0.0.0.0
|
||||||
- SERVER_PORT=80
|
- SERVER_PORT=80
|
||||||
- DBSERVER_ADDRESS=localhost
|
- DBSERVER_ADDRESS=seb-server-mariadb
|
||||||
- DBSERVER_PORT=3306
|
- DBSERVER_PORT=3306
|
||||||
|
- DBSERVER_PWD=somePW
|
||||||
|
- GUICLIENT_PWD=somePW
|
||||||
|
- INTERNAL_PWD=somePW
|
||||||
- KEYSTORE_PWD=somePW
|
- KEYSTORE_PWD=somePW
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
|
|
|
@ -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.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.driver-class-name=org.mariadb.jdbc.Driver
|
||||||
spring.datasource.platform=dev
|
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
|
# webservice configuration
|
||||||
sebserver.webservice.distributed=false
|
sebserver.webservice.distributed=false
|
||||||
|
|
|
@ -67,4 +67,13 @@
|
||||||
|
|
||||||
</springProfile>
|
</springProfile>
|
||||||
|
|
||||||
|
<springProfile name="prod">
|
||||||
|
|
||||||
|
<root level="INFO" additivity="true">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
<appender-ref ref="FILE" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</springProfile>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
Loading…
Reference in a new issue