diff --git a/docker/Dockerfile b/docker/Dockerfile index 9bd56538..b2868860 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,6 +13,12 @@ COPY docker/start-sebserver.sh seb-server.jar /sebserver/ WORKDIR /sebserver -CMD /bin/sh /sebserver/start-sebserver.sh +#CMD /bin/sh /sebserver/start-sebserver.sh + +CMD exec java \ + -Xms${JAVA_HEAP_MIN} \ + -Xmx${JAVA_HEAP_MAX} \ + -jar "seb-server.jar" \ + --spring.config.location=file:/sebserver/config/spring/,classpath:/config/; EXPOSE $SERVER_PORT $JMX_PORT \ No newline at end of file diff --git a/docker/start-sebserver.sh b/docker/start-sebserver.sh index 23dec483..8dc36a19 100644 --- a/docker/start-sebserver.sh +++ b/docker/start-sebserver.sh @@ -1,28 +1,22 @@ #!/bin/sh -exec java \ - -Xms${JAVA_HEAP_MIN} \ - -Xmx${JAVA_HEAP_MAX} \ - -jar "seb-server.jar" \ - --spring.config.location=file:/sebserver/config/spring/,classpath:/config/; - -#if [ "x${JMX_PORT}" = "x" ] ; \ -# then exec java \ -# -Xms${JAVA_HEAP_MIN} \ -# -Xmx${JAVA_HEAP_MAX} \ -# -jar "seb-server.jar" \ -# --spring.config.location=file:/sebserver/config/spring/,classpath:/config/; \ -# else echo "admin ${SEBSERVER_SECRET}" > jmxremote.password && chown spring:spring /sebserver/jmxremote.password && chmod 400 /sebserver/jmxremote.password && exec java \ -# -Xms${JAVA_HEAP_MIN} \ -# -Xmx${JAVA_HEAP_MAX} \ -# -Dcom.sun.management.jmxremote \ -# -Dcom.sun.management.jmxremote.port=${JMX_PORT} \ -# -Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} \ -# -Djava.rmi.server.hostname=localhost \ -# -Dcom.sun.management.jmxremote.local.only=false \ -# -Dcom.sun.management.jmxremote.ssl=false \ -# -Dcom.sun.management.jmxremote.authenticate=true \ -# -Dcom.sun.management.jmxremote.password.file=/sebserver/jmxremote.password \ -# -Dcom.sun.management.jmxremote.access.file=/sebserver/config/jmx/jmxremote.access \ -# -jar "seb-server.jar" \ -# --spring.config.location=file:/sebserver/config/spring/,classpath:/config/; \ -#fi \ No newline at end of file +if [ "x${JMX_PORT}" = "x" ] ; \ + then exec java \ + -Xms${JAVA_HEAP_MIN} \ + -Xmx${JAVA_HEAP_MAX} \ + -jar "seb-server.jar" \ + --spring.config.location=file:/sebserver/config/spring/,classpath:/config/; \ + else echo "admin ${SEBSERVER_SECRET}" > jmxremote.password && chown spring:spring /sebserver/jmxremote.password && chmod 400 /sebserver/jmxremote.password && exec java \ + -Xms${JAVA_HEAP_MIN} \ + -Xmx${JAVA_HEAP_MAX} \ + -Dcom.sun.management.jmxremote \ + -Dcom.sun.management.jmxremote.port=${JMX_PORT} \ + -Dcom.sun.management.jmxremote.rmi.port=${JMX_PORT} \ + -Djava.rmi.server.hostname=localhost \ + -Dcom.sun.management.jmxremote.local.only=false \ + -Dcom.sun.management.jmxremote.ssl=false \ + -Dcom.sun.management.jmxremote.authenticate=true \ + -Dcom.sun.management.jmxremote.password.file=/sebserver/jmxremote.password \ + -Dcom.sun.management.jmxremote.access.file=/sebserver/config/jmx/jmxremote.access \ + -jar "seb-server.jar" \ + --spring.config.location=file:/sebserver/config/spring/,classpath:/config/; \ +fi \ No newline at end of file