forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-cp
executable file
·33 lines (24 loc) · 957 Bytes
/
Dockerfile-cp
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
FROM node:16.13 AS superset-node
ARG NPM_VER=7
RUN npm install -g npm@${NPM_VER}
ARG NPM_BUILD_CMD="build"
ENV BUILD_CMD=${NPM_BUILD_CMD}
# NPM ci first, as to NOT invalidate previous steps except for when package.json changes
RUN mkdir -p /app/superset-frontend
RUN mkdir -p /app/superset/assets
COPY ./docker/frontend-mem-nag.sh /
COPY ./superset-frontend /app/superset-frontend
RUN /frontend-mem-nag.sh \
&& cd /app/superset-frontend \
&& npm ci
# This seems to be the most expensive step
RUN cd /app/superset-frontend \
&& npm run ${BUILD_CMD} \
&& rm -rf node_modules
# From official image, replace frontend
FROM apache/superset
USER superset
COPY --from=superset-node /app/superset/static/assets /app/superset/static/assets
COPY --from=superset-node /app/superset-frontend /app/superset-frontend
#COPY ./superset/static/assets/images /app/superset/static/assets/images
COPY ./superset/config.py /app/superset/