Fokko commented on a change in pull request #4724: [AIRFLOW-3906] Add npm
compile to docker file
URL: https://github.com/apache/airflow/pull/4724#discussion_r258866025
##########
File path: Dockerfile
##########
@@ -16,26 +16,43 @@
FROM python:3.6-slim
-COPY . /opt/airflow/
-
ARG AIRFLOW_HOME=/usr/local/airflow
ARG AIRFLOW_DEPS="all"
ARG PYTHON_DEPS=""
-ARG buildDeps="freetds-dev libkrb5-dev libsasl2-dev libssl-dev libffi-dev
libpq-dev git"
-ARG APT_DEPS="$buildDeps libsasl2-dev freetds-bin build-essential
default-libmysqlclient-dev apt-utils curl rsync netcat locales"
+ARG buildDeps="freetds-dev libkrb5-dev libssl-dev libffi-dev libpq-dev git"
+ARG APT_DEPS="libsasl2-dev freetds-bin build-essential
default-libmysqlclient-dev apt-utils curl rsync netcat locales"
-WORKDIR /opt/airflow
-RUN set -x \
+ENV PATH="$HOME/.npm-packages/bin:$PATH"
+
+RUN set -euxo pipefail \
&& apt update \
&& if [ -n "${APT_DEPS}" ]; then apt install -y $APT_DEPS; fi \
+ && curl -sL https://deb.nodesource.com/setup_10.x | bash - \
+ && apt update \
+ && apt install -y nodejs \
+ && apt autoremove -yqq --purge \
+ && apt clean
+
+COPY . /opt/airflow/
+
+WORKDIR /opt/airflow/airflow/www
+RUN npm install \
+ && npm run prod
+
+WORKDIR /opt/airflow
+RUN set -euxo pipefail \
+ && apt update \
+ && if [ -n "${buildDeps}" ]; then apt install -y $buildDeps; fi \
&& if [ -n "${PYTHON_DEPS}" ]; then pip install --no-cache-dir
${PYTHON_DEPS}; fi \
+ && pip install --no-cache-dir --upgrade pip==19.0.1 \
&& pip install --no-cache-dir --no-use-pep517 -e .[$AIRFLOW_DEPS] \
&& apt purge --auto-remove -yqq $buildDeps \
&& apt autoremove -yqq --purge \
- && apt clean
+ && apt clean \
Review comment:
Trailing `\`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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