Docker-Compose Memory Issue Fix? (#9285)

* Adding free memory nag / running npm build with development options in compose

* Adding license
This commit is contained in:
Craig Rueda
2020-03-13 09:25:54 -07:00
committed by GitHub
parent 1cbd955e79
commit e9b0095754
4 changed files with 59 additions and 2 deletions

View File

@@ -41,18 +41,23 @@ RUN cd /app \
######################################################################
FROM node:10-jessie AS superset-node
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/package* /app/superset-frontend/
RUN cd /app/superset-frontend \
RUN /frontend-mem-nag.sh \
&& cd /app/superset-frontend \
&& npm ci
# Next, copy in the rest and let webpack do its thing
COPY ./superset-frontend /app/superset-frontend
# This is BY FAR the most expensive step (thanks Terser!)
RUN cd /app/superset-frontend \
&& npm run build \
&& npm run ${BUILD_CMD} \
&& rm -rf node_modules