diff options
Diffstat (limited to 'packages/policy-api-docker')
-rw-r--r-- | packages/policy-api-docker/pom.xml | 10 | ||||
-rw-r--r-- | packages/policy-api-docker/src/main/docker/Dockerfile | 8 | ||||
-rw-r--r-- | packages/policy-api-docker/src/main/docker/policy-api.sh | 12 |
3 files changed, 23 insertions, 7 deletions
diff --git a/packages/policy-api-docker/pom.xml b/packages/policy-api-docker/pom.xml index 57078d52..e9c45879 100644 --- a/packages/policy-api-docker/pom.xml +++ b/packages/policy-api-docker/pom.xml @@ -1,7 +1,7 @@ <!-- ============LICENSE_START======================================================= Copyright (C) 2019,2021 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2020 Bell Canada. + Modifications Copyright (C) 2020-2022 Bell Canada. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -96,6 +96,12 @@ <outputDirectory>/lib</outputDirectory> <outputFileNameMapping>policy-api.tar.gz</outputFileNameMapping> </dependencySet> + <dependencySet> + <includes> + <include>org.onap.policy.api:api-main</include> + </includes> + <outputFileNameMapping>api.jar</outputFileNameMapping> + </dependencySet> </dependencySets> </inline> </assembly> @@ -157,4 +163,4 @@ <type>tar.gz</type> </dependency> </dependencies> -</project> +</project>
\ No newline at end of file diff --git a/packages/policy-api-docker/src/main/docker/Dockerfile b/packages/policy-api-docker/src/main/docker/Dockerfile index aac535d6..652d97d8 100644 --- a/packages/policy-api-docker/src/main/docker/Dockerfile +++ b/packages/policy-api-docker/src/main/docker/Dockerfile @@ -2,6 +2,7 @@ # Dockerfile # ============LICENSE_START======================================================= # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. +# Modifications Copyright (C) 2022 Bell Canada. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,15 +31,16 @@ ENV POLICY_HOME=$POLICY_HOME/api RUN mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \ chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \ mkdir /packages -COPY /maven/* /packages +COPY /maven/lib/policy-api.tar.gz /packages RUN tar xvfz /packages/policy-api.tar.gz --directory $POLICY_HOME && \ rm /packages/policy-api.tar.gz WORKDIR $POLICY_HOME COPY policy-api.sh bin/. +COPY /maven/api.jar /app -RUN chown -R policy:policy * && chmod 755 bin/*.sh +RUN chown -R policy:policy * && chmod 755 bin/*.sh && chown -R policy:policy /app USER policy WORKDIR $POLICY_HOME/bin -ENTRYPOINT [ "./policy-api.sh" ] +ENTRYPOINT [ "./policy-api.sh" ]
\ No newline at end of file diff --git a/packages/policy-api-docker/src/main/docker/policy-api.sh b/packages/policy-api-docker/src/main/docker/policy-api.sh index d058d256..5d22c03d 100644 --- a/packages/policy-api-docker/src/main/docker/policy-api.sh +++ b/packages/policy-api-docker/src/main/docker/policy-api.sh @@ -3,6 +3,7 @@ # ============LICENSE_START======================================================= # Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. # Modifications Copyright (C) 2019-2020 Nordix Foundation. +# Modifications Copyright (C) 2022 Bell Canada. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,7 +34,7 @@ else fi if [ -z "$CONFIG_FILE" ]; then - CONFIG_FILE="${POLICY_HOME}/etc/defaultConfig.json" + CONFIG_FILE="${POLICY_HOME}/etc/apiParameters.yaml" fi echo "Policy api config file: $CONFIG_FILE" @@ -53,4 +54,11 @@ if [ -f "${POLICY_HOME}/etc/mounted/logback.xml" ]; then cp -f "${POLICY_HOME}"/etc/mounted/logback.xml "${POLICY_HOME}"/etc/ fi -$JAVA_HOME/bin/java -cp "${POLICY_HOME}/etc:${POLICY_HOME}/lib/*" -Dlogback.configurationFile="${POLICY_HOME}/etc/logback.xml" -Djavax.net.ssl.keyStore="${KEYSTORE}" -Djavax.net.ssl.keyStorePassword="${KEYSTORE_PASSWD}" -Djavax.net.ssl.trustStore="${TRUSTSTORE}" -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD}" org.onap.policy.api.main.startstop.Main -c "${CONFIG_FILE}" +$JAVA_HOME/bin/java \ + -Dlogback.configurationFile="${POLICY_HOME}/etc/logback.xml" \ + -Dserver.ssl.key-store="${KEYSTORE}" \ + -Dserver.ssl.key-store-password="${KEYSTORE_PASSWD}" \ + -Djavax.net.ssl.trustStore="${TRUSTSTORE}" \ + -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD}" \ + -jar /app/api.jar \ + --spring.config.location="${CONFIG_FILE}"
\ No newline at end of file |