RehanRaza | 0e3740a | 2020-08-03 15:56:03 +0200 | [diff] [blame] | 1 | # |
| 2 | # ============LICENSE_START======================================================= |
| 3 | # ONAP : ccsdk oran |
| 4 | # ================================================================================ |
| 5 | # Copyright (C) 2019-2020 Nordix Foundation. All rights reserved. |
| 6 | # ================================================================================ |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
| 18 | # |
| 19 | # SPDX-License-Identifier: Apache-2.0 |
| 20 | # ============LICENSE_END========================================================= |
| 21 | # |
| 22 | FROM openjdk:11-jre-slim |
| 23 | |
| 24 | #install vim editor |
| 25 | RUN apt-get update |
| 26 | RUN apt-get install -y vim |
| 27 | |
| 28 | #install curl |
| 29 | RUN apt-get install -y curl |
| 30 | |
| 31 | EXPOSE 8081 8433 |
| 32 | |
| 33 | ARG JAR |
| 34 | |
| 35 | WORKDIR /opt/app/policy-agent |
| 36 | RUN mkdir -p /var/log/policy-agent |
| 37 | RUN mkdir -p /opt/app/policy-agent/etc/cert/ |
PatrikBuhr | 97a9001 | 2021-03-26 17:25:13 +0100 | [diff] [blame] | 38 | RUN mkdir -p /var/policy-management-service |
| 39 | RUN chmod -R 777 /var/policy-management-service |
| 40 | |
RehanRaza | 0e3740a | 2020-08-03 15:56:03 +0200 | [diff] [blame] | 41 | |
| 42 | RUN groupadd -r onap && useradd -ms /bin/bash a1pms -g onap |
| 43 | RUN chown -R a1pms:onap /var/log/policy-agent |
| 44 | |
| 45 | ADD /config/application.yaml /opt/app/policy-agent/config/application.yaml |
| 46 | ADD /config/application_configuration.json /opt/app/policy-agent/data/application_configuration.json_example |
| 47 | ADD /config/keystore.jks /opt/app/policy-agent/etc/cert/keystore.jks |
| 48 | ADD /config/truststore.jks /opt/app/policy-agent/etc/cert/truststore.jks |
| 49 | |
| 50 | RUN chmod -R 777 /opt/app/policy-agent/config/ |
| 51 | RUN chmod -R 777 /opt/app/policy-agent/data/ |
| 52 | |
| 53 | USER a1pms |
| 54 | |
| 55 | ADD target/${JAR} /opt/app/policy-agent/a1-policy-management-service.jar |
RehanRaza | 0e3740a | 2020-08-03 15:56:03 +0200 | [diff] [blame] | 56 | CMD ["java", "-jar", "/opt/app/policy-agent/a1-policy-management-service.jar"] |