blob: 3199bb59b613b49695eea7ee7a0bab80da363075 [file] [log] [blame]
Taka Cho2c618aa2020-09-04 08:49:10 -04001#-------------------------------------------------------------------------------
2# Dockerfile
3# ============LICENSE_START=======================================================
Pamela Dragoshdbbae8b2021-02-23 11:00:15 -05004# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
Rashmi Pujar5f919672022-02-04 21:49:30 -05005# Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
Taka Cho2c618aa2020-09-04 08:49:10 -04006# ================================================================================
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#-------------------------------------------------------------------------------
liamfallon449c40b2022-04-12 18:41:42 +010022FROM onap/policy-jre-alpine:2.4.2
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050023
Dmitry Puzikova0745a72019-03-25 15:00:06 +010024LABEL maintainer="Policy Team"
25
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050026ARG POLICY_LOGS=/var/log/onap/policy/api
27
shaoqiud0fe0492019-06-25 06:10:52 +000028ENV POLICY_LOGS=$POLICY_LOGS
29ENV POLICY_HOME=$POLICY_HOME/api
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050030
shaoqiud0fe0492019-06-25 06:10:52 +000031RUN mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \
Jim Hahn97a361d2020-01-16 16:35:45 -050032 chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \
33 mkdir /packages
Rashmi Pujar5f919672022-02-04 21:49:30 -050034COPY /maven/lib/policy-api.tar.gz /packages
shaoqiud0fe0492019-06-25 06:10:52 +000035RUN tar xvfz /packages/policy-api.tar.gz --directory $POLICY_HOME && \
shaoqiuf626b9f2019-03-06 05:37:04 +000036 rm /packages/policy-api.tar.gz
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050037
shaoqiud0fe0492019-06-25 06:10:52 +000038WORKDIR $POLICY_HOME
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050039COPY policy-api.sh bin/.
Rashmi Pujar5f919672022-02-04 21:49:30 -050040COPY /maven/api.jar /app
shaoqiud0fe0492019-06-25 06:10:52 +000041
Rashmi Pujar5f919672022-02-04 21:49:30 -050042RUN chown -R policy:policy * && chmod 755 bin/*.sh && chown -R policy:policy /app
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050043
44USER policy
shaoqiud0fe0492019-06-25 06:10:52 +000045WORKDIR $POLICY_HOME/bin
Rashmi Pujar5f919672022-02-04 21:49:30 -050046ENTRYPOINT [ "./policy-api.sh" ]