Taka Cho | 2c618aa | 2020-09-04 08:49:10 -0400 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Dockerfile |
| 3 | # ============LICENSE_START======================================================= |
Pamela Dragosh | dbbae8b | 2021-02-23 11:00:15 -0500 | [diff] [blame] | 4 | # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. |
Rashmi Pujar | 5f91967 | 2022-02-04 21:49:30 -0500 | [diff] [blame] | 5 | # Modifications Copyright (C) 2022 Bell Canada. All rights reserved. |
Taka Cho | 2c618aa | 2020-09-04 08:49:10 -0400 | [diff] [blame] | 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 | #------------------------------------------------------------------------------- |
liamfallon | 449c40b | 2022-04-12 18:41:42 +0100 | [diff] [blame^] | 22 | FROM onap/policy-jre-alpine:2.4.2 |
Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [diff] [blame] | 23 | |
Dmitry Puzikov | a0745a7 | 2019-03-25 15:00:06 +0100 | [diff] [blame] | 24 | LABEL maintainer="Policy Team" |
| 25 | |
Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [diff] [blame] | 26 | ARG POLICY_LOGS=/var/log/onap/policy/api |
| 27 | |
shaoqiu | d0fe049 | 2019-06-25 06:10:52 +0000 | [diff] [blame] | 28 | ENV POLICY_LOGS=$POLICY_LOGS |
| 29 | ENV POLICY_HOME=$POLICY_HOME/api |
Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [diff] [blame] | 30 | |
shaoqiu | d0fe049 | 2019-06-25 06:10:52 +0000 | [diff] [blame] | 31 | RUN mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \ |
Jim Hahn | 97a361d | 2020-01-16 16:35:45 -0500 | [diff] [blame] | 32 | chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \ |
| 33 | mkdir /packages |
Rashmi Pujar | 5f91967 | 2022-02-04 21:49:30 -0500 | [diff] [blame] | 34 | COPY /maven/lib/policy-api.tar.gz /packages |
shaoqiu | d0fe049 | 2019-06-25 06:10:52 +0000 | [diff] [blame] | 35 | RUN tar xvfz /packages/policy-api.tar.gz --directory $POLICY_HOME && \ |
shaoqiu | f626b9f | 2019-03-06 05:37:04 +0000 | [diff] [blame] | 36 | rm /packages/policy-api.tar.gz |
Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [diff] [blame] | 37 | |
shaoqiu | d0fe049 | 2019-06-25 06:10:52 +0000 | [diff] [blame] | 38 | WORKDIR $POLICY_HOME |
Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [diff] [blame] | 39 | COPY policy-api.sh bin/. |
Rashmi Pujar | 5f91967 | 2022-02-04 21:49:30 -0500 | [diff] [blame] | 40 | COPY /maven/api.jar /app |
shaoqiu | d0fe049 | 2019-06-25 06:10:52 +0000 | [diff] [blame] | 41 | |
Rashmi Pujar | 5f91967 | 2022-02-04 21:49:30 -0500 | [diff] [blame] | 42 | RUN chown -R policy:policy * && chmod 755 bin/*.sh && chown -R policy:policy /app |
Chenfei Gao | 6ea2e1b | 2019-01-31 16:09:09 -0500 | [diff] [blame] | 43 | |
| 44 | USER policy |
shaoqiu | d0fe049 | 2019-06-25 06:10:52 +0000 | [diff] [blame] | 45 | WORKDIR $POLICY_HOME/bin |
Rashmi Pujar | 5f91967 | 2022-02-04 21:49:30 -0500 | [diff] [blame] | 46 | ENTRYPOINT [ "./policy-api.sh" ] |