@@ -19,6 +19,7 @@ COPY --chown=redash scripts /frontend/scripts
1919# Controls whether to instrument code for coverage information
2020ARG code_coverage
2121ENV BABEL_ENV=${code_coverage:+test}
22+ ENV GITHUB_PAT=${GITHUB_PAT}
2223
2324# Avoid issues caused by lags in disk and network I/O speeds when working on top of QEMU emulation for multi-platform image building.
2425RUN yarn config set network-timeout 300000
@@ -37,7 +38,7 @@ RUN <<EOF
3738 fi
3839EOF
3940
40- FROM python:3.10 -slim-bookworm
41+ FROM python:3.11 -slim-bookworm
4142
4243EXPOSE 5000
4344
@@ -98,18 +99,18 @@ WORKDIR /app
9899ENV POETRY_VERSION=1.8.3
99100ENV POETRY_HOME=/etc/poetry
100101ENV POETRY_VIRTUALENVS_CREATE=false
102+ ENV PIP_PREFER_BINARY=1
101103RUN curl -sSL https://install.python-poetry.org | python3 -
102104
103- # Avoid crashes, including corrupted cache artifacts, when building multi-platform images with GitHub Actions.
104- RUN /etc/poetry/bin/poetry cache clear pypi --all
105-
105+ # Use BuildKit cache mount for Poetry cache to speed up builds
106106COPY pyproject.toml poetry.lock ./
107107
108- ARG POETRY_OPTIONS="--no-root --no-interaction --no-ansi "
108+ ARG POETRY_OPTIONS="--no-root --no-ansi --no-interaction "
109109# for LDAP authentication, install with `ldap3` group
110110# disabled by default due to GPL license conflict
111111ARG install_groups="main,all_ds,dev"
112- RUN /etc/poetry/bin/poetry install --only $install_groups $POETRY_OPTIONS
112+ RUN --mount=type=cache,target=/root/.cache/pypoetry \
113+ /etc/poetry/bin/poetry install --only $install_groups $POETRY_OPTIONS
113114
114115COPY --chown=redash . /app
115116COPY --from=frontend-builder --chown=redash /frontend/client/dist /app/client/dist
0 commit comments