[DCAEGEN2] Release dcaegen2-services-kpi-computation-ms container
[dcaegen2/services.git] / components / datalake-handler / admin / Dockerfile
1 # ============LICENSE_START=======================================================
2 #  Copyright (c) 2019 QCT. All rights reserved.
3 #  Copyright (c) 2022 AT&T. All rights reserved.
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 FROM node:alpine AS builder
21 MAINTAINER Ekko Chang <ekko.chang@qct.io>
22
23 LABEL org.label-schema.docker.build="docker build -t dl-admin . --no-cache" \
24       org.label-schema.docker.run="docker run -p 80:80 --add-host=dl_feeder:your_feeder_ipaddress dl-admin"
25
26 ENV NODE_OPTIONS "--openssl-legacy-provider"
27
28 WORKDIR /app
29 COPY ./src .
30 COPY ./nginx .
31 RUN npm install && \
32     npm run build
33
34
35 FROM nginx:1.17.9
36
37 RUN groupadd -r datalake && useradd -r -g datalake datalake
38
39 COPY --from=builder /app/dist/* /usr/share/nginx/html/
40 COPY --from=builder /app/dl-admin-nginx.conf /etc/nginx/conf.d/default.conf
41 COPY --from=builder /app/nginx.conf /etc/nginx/nginx.conf
42 COPY --from=builder /app/run.sh /tmp
43
44 RUN chown -R datalake:datalake /etc/nginx
45 RUN chown -R datalake:datalake /var/cache/nginx
46 RUN chown -R datalake:datalake /tmp/run.sh
47 RUN chmod 0744 /tmp/run.sh
48
49
50 USER datalake
51
52 CMD ["sh", "-c", "/tmp/run.sh"]
53