blob: a876fb88b282f9b06e5a28189aa7547e9aa3d1e5 [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.
Taka Cho2c618aa2020-09-04 08:49:10 -04005# ================================================================================
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18# SPDX-License-Identifier: Apache-2.0
19# ============LICENSE_END=========================================================
20#-------------------------------------------------------------------------------
Pamela Dragoshdbbae8b2021-02-23 11:00:15 -050021FROM onap/policy-jre-alpine:2.2.1
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050022
Dmitry Puzikova0745a72019-03-25 15:00:06 +010023LABEL maintainer="Policy Team"
24
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050025ARG POLICY_LOGS=/var/log/onap/policy/api
26
shaoqiud0fe0492019-06-25 06:10:52 +000027ENV POLICY_LOGS=$POLICY_LOGS
28ENV POLICY_HOME=$POLICY_HOME/api
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050029
shaoqiud0fe0492019-06-25 06:10:52 +000030RUN mkdir -p $POLICY_LOGS $POLICY_HOME $POLICY_HOME/bin && \
Jim Hahn97a361d2020-01-16 16:35:45 -050031 chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \
32 mkdir /packages
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050033COPY /maven/* /packages
shaoqiud0fe0492019-06-25 06:10:52 +000034RUN tar xvfz /packages/policy-api.tar.gz --directory $POLICY_HOME && \
shaoqiuf626b9f2019-03-06 05:37:04 +000035 rm /packages/policy-api.tar.gz
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050036
shaoqiud0fe0492019-06-25 06:10:52 +000037WORKDIR $POLICY_HOME
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050038COPY policy-api.sh bin/.
shaoqiud0fe0492019-06-25 06:10:52 +000039
40RUN chown -R policy:policy * && chmod 755 bin/*.sh
Chenfei Gao6ea2e1b2019-01-31 16:09:09 -050041
42USER policy
shaoqiud0fe0492019-06-25 06:10:52 +000043WORKDIR $POLICY_HOME/bin
Taka Chob47abde2020-11-30 14:06:16 -050044ENTRYPOINT [ "./policy-api.sh" ]