1bcf4b06c6af0261ea31452a998e2334d155833f
[clamp.git] / src / main / docker / frontend / Dockerfile
1 ###\r
2 # ============LICENSE_START=======================================================\r
3 # ONAP CLAMP\r
4 # ================================================================================\r
5 # Copyright (C) 2019 AT&T Intellectual Property. All rights\r
6 #                             reserved.\r
7 # ================================================================================\r
8 # Licensed under the Apache License, Version 2.0 (the "License");\r
9 # you may not use this file except in compliance with the License.\r
10 # You may obtain a copy of the License at\r
11 #\r
12 # http://www.apache.org/licenses/LICENSE-2.0\r
13 #\r
14 # Unless required by applicable law or agreed to in writing, software\r
15 # distributed under the License is distributed on an "AS IS" BASIS,\r
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
17 # See the License for the specific language governing permissions and\r
18 # limitations under the License.\r
19 # ============LICENSE_END============================================\r
20 # ===================================================================\r
21 #\r
22 ###\r
23 \r
24 # build environment\r
25 FROM node:12.10.0-alpine as build\r
26 WORKDIR /app\r
27 #ENV PATH /app/node_modules/.bin:$PATH\r
28 COPY onap-clamp-frontend/ /app/\r
29 RUN npm install --silent\r
30 RUN npm run build\r
31 \r
32 FROM nginx:1.17.0-alpine\r
33 \r
34 MAINTAINER "The Onap Team"\r
35 LABEL Description="This image contains Clamp frontend"\r
36 \r
37 ARG http_proxy\r
38 ARG https_proxy\r
39 ENV HTTP_PROXY=$http_proxy\r
40 ENV HTTPS_PROXY=$https_proxy\r
41 ENV http_proxy=$HTTP_PROXY\r
42 ENV https_proxy=$HTTPS_PROXY\r
43 \r
44 RUN addgroup onap && adduser -D -G onap clamp\r
45 RUN mkdir /var/log/onap\r
46 RUN chmod a+rwx /var/log/onap\r
47 \r
48 COPY --from=build /app/build /usr/share/nginx/html\r
49 COPY --from=build /app/ssl /etc/ssl\r
50 RUN rm /etc/nginx/conf.d/default.conf\r
51 RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log\r
52 COPY nginx/nginx.conf /etc/nginx/conf.d\r
53 EXPOSE 443\r
54 USER clamp\r
55 CMD ["nginx", "-g", "daemon off;"]