blob: b7ba49494e952f7c6f523784b8b21a5e7b3da3bb [file] [log] [blame]
danielhanrahan608e6252021-08-20 16:55:19 +01001#-------------------------------------------------------------------------------
2# ============LICENSE_START=======================================================
3# Copyright (C) 2021 Nordix Foundation.
4# ================================================================================
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# SPDX-License-Identifier: Apache-2.0
18# ============LICENSE_END=========================================================
19#-------------------------------------------------------------------------------
20
21FROM onap/policy-jre-alpine:2.3.0
22
23LABEL maintainer="Policy Team"
24
25ARG POLICY_LOGS=/var/log/onap/policy/gui
26
27ENV POLICY_LOGS=$POLICY_LOGS
28ENV POLICY_HOME=$POLICY_HOME/gui
danielhanrahan608e6252021-08-20 16:55:19 +010029
30RUN mkdir -p $POLICY_HOME $POLICY_LOGS $POLICY_HOME/bin $POLICY_HOME/lib && \
31 chown -R policy:policy $POLICY_HOME $POLICY_LOGS && \
32 apk update && \
danielhanrahan69d300a2021-09-08 17:55:13 +010033 apk add --no-cache nginx
danielhanrahan608e6252021-08-20 16:55:19 +010034
danielhanrahan69d300a2021-09-08 17:55:13 +010035COPY --chown=policy:policy etc/ /etc/
36COPY --chown=policy:policy policy-gui.sh $POLICY_HOME/bin/
danielhanrahan9fd5ad22021-09-17 18:58:20 +010037ADD --chown=policy:policy index.html /maven/gui-clamp-html.tar.gz /usr/share/nginx/html/
danielhanrahan69d300a2021-09-08 17:55:13 +010038RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
danielhanrahan608e6252021-08-20 16:55:19 +010039 ln -sf /dev/stderr /var/log/nginx/error.log && \
40 touch /var/run/nginx.pid && \
danielhanrahan69d300a2021-09-08 17:55:13 +010041 chown -R policy:policy /etc/nginx /usr/share/nginx /var/lib/nginx /var/log/nginx /var/run/nginx.pid && \
42 chmod 755 $POLICY_HOME/bin/*.sh
danielhanrahan608e6252021-08-20 16:55:19 +010043
44USER policy
45WORKDIR $POLICY_HOME/bin
46ENTRYPOINT [ "./policy-gui.sh" ]
danielhanrahan1f680352021-09-08 10:49:44 +010047EXPOSE 2443