FROM node:24-bookworm AS frontend-builder RUN npm install --global pnpm@10.30.3 # Controls whether to build the frontend assets ARG skip_frontend_build ENV CYPRESS_INSTALL_BINARY=0 ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 RUN useradd -m -d /frontend redash USER redash WORKDIR /frontend COPY --chown=redash package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc /frontend/ COPY --chown=redash viz-lib /frontend/viz-lib COPY --chown=redash scripts /frontend/scripts # Controls whether to instrument code for coverage information ARG code_coverage ENV BABEL_ENV=${code_coverage:+test} # Use BuildKit cache mount for pnpm store to speed rebuilds RUN --mount=type=cache,id=pnpm-store,target=/frontend/.cache/pnpm,uid=1001,gid=1001 \ pnpm config set store-dir /frontend/.cache/pnpm && \ if [ "x$skip_frontend_build" = "x" ] ; then pnpm install --frozen-lockfile; fi COPY --chown=redash client /frontend/client COPY --chown=redash webpack.config.js /frontend/ # Use the same cache mount for the build step RUN --mount=type=cache,id=pnpm-store,target=/frontend/.cache/pnpm,uid=1001,gid=1001 < /etc/apt/sources.list.d/mssql-release.list apt-get update ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql18 apt-get clean rm -rf /var/lib/apt/lists/* curl "$databricks_odbc_driver_url" --location --output /tmp/simba_odbc.zip chmod 600 /tmp/simba_odbc.zip unzip /tmp/simba_odbc.zip -d /tmp/simba dpkg -i /tmp/simba/*.deb printf "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini rm /tmp/simba_odbc.zip rm -rf /tmp/simba fi EOF WORKDIR /app # Install uv (pinned) from the official distroless image for a reproducible build. COPY --from=ghcr.io/astral-sh/uv:0.11.6 /uv /usr/local/bin/uv # Install into the system environment rather than a project-local virtualenv, # so console scripts (gunicorn, supervisord, rq, ...) are on PATH. ENV UV_PROJECT_ENVIRONMENT=/usr/local ENV UV_COMPILE_BYTECODE=1 ENV UV_LINK_MODE=copy COPY pyproject.toml uv.lock ./ ARG UV_OPTIONS="--frozen --no-install-project --no-default-groups" # for LDAP authentication, install with the `ldap3` group # disabled by default due to GPL license conflict ARG install_groups="main,all_ds,dev" # Translate the comma-separated install_groups list into uv flags. "main" # refers to the project's base dependencies (always installed); every other # entry maps to a uv dependency group. RUN --mount=type=cache,target=/root/.cache/uv <