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_r264326380
##########
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:
Actually it gets even better: with setting custom prefix in Docker -> this
way node_modules will be installed and used from /cache/node_modules - not
messing with the code of the application. So even if we mount the sources from
local directory we will keep node_modules installed via Docker (and you need
both package and package-lock to make 'npm ci' works :)). Just checked.
----------------------------------------------------------------
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