blob: 279e94d5057ff3668333341d051d4d94450cadf9 [file] [log] [blame]
sebdetc95e8df2019-06-25 11:06:06 +02001###
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
sebdet101193d2019-09-05 18:25:59 +020025FROM node:12.10.0-alpine as build
sebdetc95e8df2019-06-25 11:06:06 +020026WORKDIR /app
27#ENV PATH /app/node_modules/.bin:$PATH
28COPY onap-clamp-frontend/ /app/
29RUN npm install --silent
30RUN 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 && adduser -D -G onap clamp
45RUN mkdir /var/log/onap
46RUN chmod a+rwx /var/log/onap
47
48COPY --from=build /app/build /usr/share/nginx/html
sebdet1e865922019-08-27 17:56:04 -070049COPY --from=build /app/ssl /etc/ssl
sebdetc95e8df2019-06-25 11:06:06 +020050RUN rm /etc/nginx/conf.d/default.conf
sebdet101193d2019-09-05 18:25:59 +020051RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
sebdet1e865922019-08-27 17:56:04 -070052COPY nginx/nginx.conf /etc/nginx/conf.d
53EXPOSE 443
sebdetc95e8df2019-06-25 11:06:06 +020054CMD ["nginx", "-g", "daemon off;"]