@@ -43,10 +43,10 @@ ARG TARGETOS
4343ARG CYCLONEDX_BOM_VERSION
4444ARG UV_VERSION
4545ARG NODEJS_VERSION
46+ ARG NVM_VERSION
4647ARG STACKABLE_USER_UID
4748
48- RUN microdnf module enable -y nodejs:${NODEJS_VERSION} && \
49- microdnf update \
49+ RUN microdnf update \
5050 && microdnf install \
5151 cyrus-sasl-devel \
5252 # Needed by ./configure to work out SQLite compilation flags, see snippet [1] at the end of file
@@ -66,9 +66,6 @@ RUN microdnf module enable -y nodejs:${NODEJS_VERSION} && \
6666 python${PYTHON_VERSION}-pip \
6767 python${PYTHON_VERSION}-wheel \
6868 libpq-devel \
69- # Needed to build Superset UI assets
70- npm \
71- nodejs \
7269 # Needed to create the source code snapshot
7370 tar \
7471 # Needed by `npm run build`:
@@ -86,12 +83,27 @@ COPY --chown=${STACKABLE_USER_UID}:0 superset/stackable/patches/${PRODUCT_VERSIO
8683
8784WORKDIR /stackable
8885
86+ RUN <<EOF
87+ # Download nvm to manage Node and npm installation
88+ curl "https://repo.stackable.tech/repository/packages/nvm/nvm-${NVM_VERSION}.sh" -o /stackable/nvm.sh
89+ source /stackable/nvm.sh
90+
91+ # Install the specified version of Node (including the latest compatible version of npm)
92+ nvm install "$NODEJS_VERSION" --latest-npm
93+
94+ node --version
95+ npm --version
96+ EOF
97+
8998# Upgrade pip to the latest version
9099# Also install uv to get support for build constraints
91100# DL3042 false-positive, --no-chache-dir is specified a few lines below.
92101# See https://github.com/hadolint/hadolint/issues/1042.
93102# hadolint ignore=DL3042
94103RUN <<EOF
104+ # This makes node and npm available in the path
105+ source /stackable/nvm.sh
106+
95107python${PYTHON_VERSION} -m venv --system-site-packages /stackable/app
96108
97109source /stackable/app/bin/activate
0 commit comments