Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIRFLOW-3906] Add npm compile to docker file #4724

Merged
merged 8 commits into from
Feb 28, 2019
25 changes: 19 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,39 @@

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"
ffinfo marked this conversation as resolved.
Show resolved Hide resolved

ENV PATH="$HOME/.npm-packages/bin:$PATH"

RUN if [ -n "${APT_DEPS}" ]; then apt install -y $APT_DEPS; fi \
&& apt autoremove -yqq --purge \
&& apt clean

COPY . /opt/airflow/

WORKDIR /opt/airflow
RUN set -x \
&& apt update \
&& if [ -n "${APT_DEPS}" ]; then apt install -y $APT_DEPS; fi \
&& if [ -n "${buildDeps}" ]; then apt install -y $buildDeps; fi \
&& curl -sL https://deb.nodesource.com/setup_11.x | bash - \
&& apt install -y nodejs \
ffinfo marked this conversation as resolved.
Show resolved Hide resolved
&& if [ -n "${PYTHON_DEPS}" ]; then pip install --no-cache-dir ${PYTHON_DEPS}; fi \
&& pip install --no-cache-dir --upgrade pip \
ffinfo marked this conversation as resolved.
Show resolved Hide resolved
&& 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 \
ffinfo marked this conversation as resolved.
Show resolved Hide resolved
&& cd /opt/airflow/airflow/www \
&& npm install \
&& npm run prod
ffinfo marked this conversation as resolved.
Show resolved Hide resolved

WORKDIR $AIRFLOW_HOME
RUN mkdir -p $AIRFLOW_HOME
ENV AIRFLOW_HOME=$AIRFLOW_HOME
ffinfo marked this conversation as resolved.
Show resolved Hide resolved
COPY scripts/docker/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["--help"]