potiuk commented on a change in pull request #4543: [AIRFLOW-3718] [WIP]
Multi-layered version of the docker image
URL: https://github.com/apache/airflow/pull/4543#discussion_r266355859
##########
File path: Dockerfile
##########
@@ -70,6 +70,16 @@ COPY --from=wheel-cache /cache /cache
RUN pip install ${PIP_CACHE_DIRECTIVE} --upgrade pip==19.0.1 && \
pip install ${PIP_CACHE_DIRECTIVE} --no-use-pep517 -e ".[${EXTRAS}]"
+# Install necessary NPM dependencies - also taking into account only changes
in package.json
+COPY airflow/www/ /opt/airflow/airflow/www/
+
+WORKDIR /opt/airflow/airflow/www
+
+RUN npm ci \
Review comment:
I will take a look at that still. As mentioned in another thread,
node_modules are now generated in the source code tree. That causes a number of
problems when the sources are mounted (the node_modules might be generated
either in docker or from an external npm which might be different version.
I will take a look at the possibility of moving the node_modules permanently
out of the sources tree inside docker (not in the host). This will keep the
local development workflow (and IDE integration for example) untouched -
node_modules will still be in the sources. Since the node_modules are already
exclueded from the Docker context via .dockerignore this is fine for CI
execution, but moving node_modules out will help in case the sources are
mounted to inside the container.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services