blob: 7fd6da9bc7fd47fda39d6b99df739c31ca84d81b [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.
danielhanrahan4be03952022-06-27 16:23:29 +01006# Modifications Copyright (C) 2022 Nordix Foundation.
Taka Cho2c618aa2020-09-04 08:49:10 -04007# ================================================================================
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19#
20# SPDX-License-Identifier: Apache-2.0
21# ============LICENSE_END=========================================================
22#-------------------------------------------------------------------------------
liamfalloncea027d2022-04-27 20:55:36 +010023FROM onap/policy-jre-alpine:2.4.3
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050024
Dmitry Puzikova0745a72019-03-25 15:00:06 +010025LABEL maintainer="Policy Team"
danielhanrahan4be03952022-06-27 16:23:29 +010026LABEL org.opencontainers.image.title="Policy API"
27LABEL org.opencontainers.image.description="Policy API image based on Alpine"
28LABEL org.opencontainers.image.url="https://github.com/onap/policy-api"
29LABEL org.opencontainers.image.vendor="ONAP Policy Team"
30LABEL org.opencontainers.image.licenses="Apache-2.0"
31LABEL org.opencontainers.image.created="${git.build.time}"
32LABEL org.opencontainers.image.version="${git.build.version}"
33LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
Dmitry Puzikova0745a72019-03-25 15:00:06 +010034
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050035ARG POLICY_LOGS=/var/log/onap/policy/api
36
shaoqiud0fe0492019-06-25 06:10:52 +000037ENV POLICY_LOGS=$POLICY_LOGS
38ENV POLICY_HOME=$POLICY_HOME/api
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050039
shaoqiud0fe0492019-06-25 06:10:52 +000040RUN mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \
Jim Hahn97a361d2020-01-16 16:35:45 -050041 chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \
42 mkdir /packages
Rashmi Pujar5f919672022-02-04 21:49:30 -050043COPY /maven/lib/policy-api.tar.gz /packages
shaoqiud0fe0492019-06-25 06:10:52 +000044RUN tar xvfz /packages/policy-api.tar.gz --directory $POLICY_HOME && \
shaoqiuf626b9f2019-03-06 05:37:04 +000045 rm /packages/policy-api.tar.gz
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050046
shaoqiud0fe0492019-06-25 06:10:52 +000047WORKDIR $POLICY_HOME
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050048COPY policy-api.sh bin/.
Rashmi Pujar5f919672022-02-04 21:49:30 -050049COPY /maven/api.jar /app
shaoqiud0fe0492019-06-25 06:10:52 +000050
Rashmi Pujar5f919672022-02-04 21:49:30 -050051RUN chown -R policy:policy * && chmod 755 bin/*.sh && chown -R policy:policy /app
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050052
53USER policy
shaoqiud0fe0492019-06-25 06:10:52 +000054WORKDIR $POLICY_HOME/bin
danielhanrahan4be03952022-06-27 16:23:29 +010055ENTRYPOINT [ "./policy-api.sh" ]