diff --git a/.github/workflows/docker-build-validation.yml b/.github/workflows/docker-build-validation.yml index 4b9fde5a0b44..c543ca424eef 100644 --- a/.github/workflows/docker-build-validation.yml +++ b/.github/workflows/docker-build-validation.yml @@ -74,6 +74,19 @@ jobs: cubejs_api_url=http://localhost:4000 cubejs_api_secret=build-time-placeholder + - name: Verify Runtime Image Excludes npm + shell: bash + run: | + set -euo pipefail + + docker run --rm --entrypoint sh "formbricks-test:$GITHUB_SHA" -c ' + set -eu + test ! -d /usr/local/lib/node_modules/npm + ! command -v npm >/dev/null 2>&1 + ! command -v npx >/dev/null 2>&1 + node --version + ' + - name: Reject Invalid Environment Before Database Setup shell: bash env: diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index e7467d29cb05..8fe26f170d36 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -80,10 +80,11 @@ RUN --mount=type=secret,id=database_url \ # FROM base AS runner -# Upgrade Alpine system packages to pick up security patches, update npm to the patched 11.x line, then create user -# Note: npm is updated in the runtime image so any bundled transitive packages scanned from the base image are patched +# Upgrade Alpine system packages, remove build-only npm tooling from the runtime image, then create user. +# The application and startup migrations run directly with Node.js; npm and npx are only needed in the installer. RUN apk update && apk upgrade --no-cache \ - && npm install --ignore-scripts -g npm@11.17.0 \ + && rm -rf /usr/local/lib/node_modules/npm \ + && rm -f /usr/local/bin/npm /usr/local/bin/npx \ && addgroup -S nextjs \ && adduser -S -u 1001 -G nextjs nextjs diff --git a/docs/surveys/general-features/multi-language-surveys.mdx b/docs/surveys/general-features/multi-language-surveys.mdx index 83482dc310c3..47b0191bdf44 100644 --- a/docs/surveys/general-features/multi-language-surveys.mdx +++ b/docs/surveys/general-features/multi-language-surveys.mdx @@ -10,16 +10,6 @@ How to deliver a specific language depends on the survey type (app or link surve - Link survey: Add a `lang` parameter in the survey URL. [Read this guide for Link Surveys](#link-surveys-configuration) - - ## Purpose Source tracking for link surveys is essential when you: