-
Notifications
You must be signed in to change notification settings - Fork 16.4k
[AIRFLOW-3906] Add npm compile to docker file #4724
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
Changes from all commits
694670a
00fdc19
d0dcaec
a6b8184
ce75dd2
fc836b1
4c55f58
02d1dea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,21 +16,37 @@ | |
|
|
||
| FROM python:3.6-slim | ||
|
|
||
| COPY . /opt/airflow/ | ||
|
|
||
| ARG AIRFLOW_HOME=/usr/local/airflow | ||
| ENV 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 BUILD_DEPS="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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -1 to doing it this way: Having Node and all of the node_modules in the final image isn't great. Instead we should use a multi-stage docker file so this line becomes: And then earlier in the docker file we have (i.e. right at the start)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as @jmcarp said in #4724 (comment) |
||
|
|
||
| WORKDIR /opt/airflow | ||
| RUN set -euxo pipefail \ | ||
| && apt update \ | ||
| && if [ -n "${BUILD_DEPS}" ]; then apt install -y $BUILD_DEPS; 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 purge --auto-remove -yqq $BUILD_DEPS \ | ||
| && apt autoremove -yqq --purge \ | ||
| && apt clean | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.