blob: 1d64d2a2d2fe34cb493beb1c9421cbb2cf9982dc [file] [log] [blame]
Sirisha_Manchikantif83411a2021-05-07 15:17:52 +01001###
2# ============LICENSE_START=======================================================
3# ONAP CLAMP
4# ================================================================================
5# Copyright (C) 2019 AT&T Intellectual Property. All rights
6# reserved.
7# ================================================================================
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# ============LICENSE_END============================================
20# ===================================================================
21#
22###
23
24# build environment
25FROM node:12.10.0-alpine as build
26WORKDIR /app
27#ENV PATH /app/node_modules/.bin:$PATH
28COPY onap-policy-clamp-frontend/ /app/
29RUN npm install --silent && \
30 npm run build
31
32FROM nginx:1.17.0-alpine
33
34MAINTAINER "The Onap Team"
35LABEL Description="This image contains Clamp frontend"
36
37ARG http_proxy
38ARG https_proxy
39ENV HTTP_PROXY=$http_proxy
40ENV HTTPS_PROXY=$https_proxy
41ENV http_proxy=$HTTP_PROXY
42ENV https_proxy=$HTTPS_PROXY
43
44RUN addgroup onap && \
45 adduser -D -G onap clamp && \
46 mkdir /var/log/onap && \
47 chmod a+rwx /var/log/onap
48
49COPY --from=build /app/build /usr/share/nginx/html
50COPY --from=build /app/ssl /etc/ssl
51
52RUN rm /etc/nginx/conf.d/default.conf && \
53 ln -sf /dev/stdout /var/log/nginx/access.log && \
54 ln -sf /dev/stderr /var/log/nginx/error.log
55
56COPY nginx/nginx.conf /etc/nginx/nginx.conf
57COPY nginx/default.conf /etc/nginx/conf.d/default.conf
58
59WORKDIR /app
60
61RUN chown -R clamp:onap /app && chmod -R 755 /app && \
62 chown -R clamp:onap /var/cache/nginx && \
63 chown -R clamp:onap /var/log/nginx && \
64 chown -R clamp:onap /etc/nginx/conf.d && \
65 touch /var/run/nginx.pid && \
66 chown -R clamp:onap /var/run/nginx.pid
67
68USER clamp
69EXPOSE 2443
70CMD ["nginx", "-g", "daemon off;"]
71