-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (35 loc) · 1.3 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Dockerfile for Diffraflow-Dashboard project
# maintainer: Zhengheng Li <[email protected]>
# build ############################################################
# FROM zhenghengli/angular:10.1.5 AS builder
FROM registry.starlightdf.cc/lizhengheng/docker-angular:10.1.5 AS builder
ARG SOURCE_DIR=/opt/angular-devel
ADD $PWD $SOURCE_DIR
RUN set -x \
&& cd $SOURCE_DIR \
&& npm install \
&& npx ng build --prod
# deploy ############################################################
FROM nginx:stable-alpine
ARG DIST_DIR=/opt/angular-devel/dist/diffraflow-dashboard
ARG ROOT_DIR=/usr/share/nginx/html
# copy from builder
COPY --from=builder $DIST_DIR $ROOT_DIR
# add labels
ARG SOURCE_COMMIT
ARG COMMIT_MSG
ARG BUILD_TIME
LABEL description="Dashboard for DiffraFlow project" \
maintainer="Zhengheng Li <[email protected]>" \
source_commit="$SOURCE_COMMIT" \
commit_msg="$COMMIT_MSG" \
build_time="$BUILD_TIME"
# set runtime environment variables
ENV AGGREGATOR_ADDRESS="10.15.86.21:27711" \
CONTROLLER_ADDRESS="10.15.86.20:27511" \
INGESTER_CONFIG="ingester.dyconf" \
MONITOR_CONFIG="monitor.dyconf"
COPY scripts/30-serve-index-when-not-found.sh /docker-entrypoint.d
COPY scripts/entrypoint.sh /scripts/
ENTRYPOINT [ "/scripts/entrypoint.sh" ]
CMD ["nginx", "-g", "daemon off;"]