pwang2 commented on code in PR #21583:
URL: https://github.com/apache/superset/pull/21583#discussion_r988480069
##########
Dockerfile:
##########
@@ -15,60 +15,34 @@
# limitations under the License.
#
-######################################################################
-# PY stage that simply does a pip install on our requirements
-######################################################################
-ARG PY_VER=3.8.13-slim
-FROM python:${PY_VER} AS superset-py
-
-RUN mkdir /app \
- && apt-get update -y \
- && apt-get install -y --no-install-recommends \
- build-essential \
- default-libmysqlclient-dev \
- libpq-dev \
- libsasl2-dev \
- libecpg-dev \
- && rm -rf /var/lib/apt/lists/*
-
-# First, we just wanna install requirements, which will allow us to utilize
the cache
-# in order to only build if and only if requirements change
-COPY ./requirements/*.txt /app/requirements/
-COPY setup.py MANIFEST.in README.md /app/
-COPY superset-frontend/package.json /app/superset-frontend/
-RUN cd /app \
- && mkdir -p superset/static \
- && touch superset/static/version_info.json \
- && pip install --no-cache -r requirements/local.txt
-
-
######################################################################
# Node stage to deal with static asset construction
######################################################################
+ARG PY_VER=3.8.13-slim
FROM node:16-slim 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 /app/superset-frontend
-RUN /frontend-mem-nag.sh \
- && cd /app/superset-frontend \
- && npm ci
+RUN /frontend-mem-nag.sh
-# This seems to be the most expensive step
-RUN cd /app/superset-frontend \
- && npm run ${BUILD_CMD} \
- && rm -rf node_modules
+WORKDIR /app/superset-frontend/
+COPY superset-frontend/package*.json .
Review Comment:
Thanks, @EugeneTorap , I tested, without / works seems okay. but it looks
more obvious when adding slash here. :)
<img width="252" alt="image"
src="https://user-images.githubusercontent.com/1592014/194195452-43d02154-cab0-4dec-acf5-eea3f9464f70.png">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]