Skip to content

Commit

Permalink
Merge pull request #696 from MonobikashDas/1.1.4
Browse files Browse the repository at this point in the history
MOSIP-11733 : Adding TTL/eviction support for spring cache
  • Loading branch information
gsasikumar authored Feb 5, 2021
2 parents 0961f28 + f52e502 commit 50498f7
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions commons-packet/commons-packet-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ ENV artifactory_url_env=${artifactory_url}
# environment variable to pass iam_adapter url, at docker runtime
ENV iam_adapter_url_env=${iam_adapter_url}

# environment variable to pass iam_adapter url, at docker runtime
ENV cache_provider_url_env=${cache_provider_url}

# install packages and create user
RUN apt-get -y update \
&& apt-get install -y unzip \
Expand All @@ -63,6 +66,14 @@ RUN apt-get -y update \
# set working directory for the user
WORKDIR /home/${container_user}

ENV work_dir=/home/${container_user}

ARG loader_path=${work_dir}/additional_jars/

RUN mkdir -p ${loader_path}

ENV loader_path_env=${loader_path}

COPY ./target/commons-packet-service-*.jar commons-packet-service.jar

# change permissions of file inside working dir
Expand All @@ -74,15 +85,17 @@ USER ${container_user_uid}:${container_user_gid}
EXPOSE 8086

CMD if [ "$is_glowroot_env" = "present" ]; then \
wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \
wget "${iam_adapter_url_env}" -O kernel-auth-adapter.jar; \
wget -q --show-progress "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \
wget -q --show-progress "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
wget -q --show-progress "${cache_provider_url_env}" -O "${loader_path_env}"/cache-provider.jar; \
unzip glowroot.zip ; \
rm -rf glowroot.zip ; \
sed -i 's/<service_name>/commons-packet-service/g' glowroot/glowroot.properties ; \
java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -XX:+UseStringDeduplication -Dloader.path=./kernel-auth-adapter.jar -jar -javaagent:glowroot/glowroot.jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" commons-packet-service.jar ; \
java -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -XX:+UseStringDeduplication -Dloader.path="${loader_path_env}" -jar -javaagent:glowroot/glowroot.jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" commons-packet-service.jar ; \
else \
wget "${iam_adapter_url_env}" -O kernel-auth-adapter.jar; \
java -Dloader.path=./kernel-auth-adapter.jar -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" commons-packet-service.jar; \
wget -q --show-progress "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
wget -q --show-progress "${cache_provider_url_env}" -O "${loader_path_env}"/cache-provider.jar; \
java -Dloader.path="${loader_path_env}" -jar -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" commons-packet-service.jar; \
fi

#CMD ["java", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-XX:MaxRAMFraction=1", "-XX:+HeapDumpOnOutOfMemoryError", "-XX:+UseG1GC", "-XX:+UseStringDeduplication", "-jar", "-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}", "-Dcom.sun.management.jmxremote=true", "-Dcom.sun.management.jmxremote.rmi.port="${management.jmxremote.rmi.port_env}"8099" , "-Dcom.sun.management.jmxremote.port="${management.jmxremote.rmi.port_env}"", "-Dcom.sun.management.jmxremote.ssl=false" ,"-Dcom.sun.management.jmxremote.authenticate=false", "-Dcom.sun.management.jmxremote.local.only=false", "-Djava.rmi.server.hostname="${management.rmi.server.hostname_env}"" , "commons-packet-service.jar"]

0 comments on commit 50498f7

Please sign in to comment.