diff --git a/server/serving-api/Dockerfile b/server/serving-api/Dockerfile index 27352a9f..8b99a508 100644 --- a/server/serving-api/Dockerfile +++ b/server/serving-api/Dockerfile @@ -10,11 +10,12 @@ ARG APPLICATION_BUILD_DATESTR ENV APPLICATION_CUSTOMER_ENTITY=$APPLICATION_CUSTOMER_ENTITY ENV APPLICATION_BUILD_DATESTR=$APPLICATION_BUILD_DATESTR +ENV SPRING_PROFILES_ACTIVE=docker LABEL org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.vcs-url="https://github.com/cskefu/cskefu" -RUN rm -rf /opt/cskefu && mkdir /opt/cskefu +RUN rm -rf /opt/cskefu && mkdir /opt/cskefu && mkdir /opt/cskefu/felix-cache COPY ./target/serving-api.jar /opt/cskefu/serving-api.jar COPY ./target/internal-bundles /opt/cskefu/internal-bundles COPY ./assets/*.sh /opt/cskefu diff --git a/server/serving-api/assets/docker-entrypoint.sh b/server/serving-api/assets/docker-entrypoint.sh index d8bf4d29..e46bedff 100755 --- a/server/serving-api/assets/docker-entrypoint.sh +++ b/server/serving-api/assets/docker-entrypoint.sh @@ -11,6 +11,7 @@ baseDir=$(cd `dirname "$0"`;pwd) # main [ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return cd $baseDir +echo ">> SPRING_PROFILES_ACTIVE="$SPRING_PROFILES_ACTIVE # TODO, setup db or upgrade db diff --git a/server/serving-api/src/main/resources/application-docker.properties b/server/serving-api/src/main/resources/application-docker.properties new file mode 100644 index 00000000..3050075b --- /dev/null +++ b/server/serving-api/src/main/resources/application-docker.properties @@ -0,0 +1,23 @@ +# -------------------------------- +# Felix Framework settings +# https://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-configuration-properties.html +# -------------------------------- +# If true will configure a shutdown hook to shutdown the framework on JVM shutdown +plugins.config.felix.shutdown.hook=true +# Where is the felix bundle cache dir +plugins.config.org.osgi.framework.storage=/opt/cskefu/felix-cache +# When to clean the felix-cache directory +plugins.config.org.osgi.framework.storage.clean=onFirstInit +# Directory to look for bundles to deploy once when framework first loads +plugins.config.felix.auto.deploy.dir=/opt/cskefu/internal-bundles +# Actions to perform on discovered bundles +plugins.config.felix.auto.deploy.action=install,start,update,uninstall +plugins.config.felix.startlevel.bundle=1 +plugins.config.felix.fileinstall.dir=/opt/cskefu/plugins +plugins.config.felix.fileinstall.log.level=2 +plugins.config.felix.fileinstall.bundles.updateWithListeners=true +plugins.config.org.osgi.framework.system.packages.extra=org.osgi.framework,org.xml.sax,org.xml.sax.helpers,javax.xml.parsers,javax.naming +plugins.config.auto.exported.packages=com.cskefu.mod.plugin,org.slf4j + +server.port=6500 +server.servlet.context-path=/api