From c6729dadf88841533f1c2af57285aeb720810c8a Mon Sep 17 00:00:00 2001 From: Elias Date: Wed, 29 Jul 2026 19:46:47 +0300 Subject: [PATCH] fix(analytics): pass the Clarity project id into the image build Declare NEXT_PUBLIC_CLARITY_PROJECT_ID as a build arg in Dockerfile.dev and pass it from the Docker Hub workflow. Next.js inlines NEXT_PUBLIC_* values during the build, so the id has to be present when the image is compiled. --- .github/workflows/build-and-push-dockerhub.yml | 1 + Dockerfile.dev | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/build-and-push-dockerhub.yml b/.github/workflows/build-and-push-dockerhub.yml index a823e5aceb..79eed173c3 100644 --- a/.github/workflows/build-and-push-dockerhub.yml +++ b/.github/workflows/build-and-push-dockerhub.yml @@ -74,6 +74,7 @@ jobs: tags: ${{ steps.prepare-tags.outputs.tags }} build-args: | NEXT_PUBLIC_VERSION=${{ steps.set-vars.outputs.short_sha }} + NEXT_PUBLIC_CLARITY_PROJECT_ID=jvv0pvzi3x labels: | org.opencontainers.image.revision=${{ steps.set-vars.outputs.short_sha }} org.opencontainers.image.source=${{ github.repository }} diff --git a/Dockerfile.dev b/Dockerfile.dev index 5f51d2c715..13c02cff2a 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,6 +1,8 @@ FROM node:22.20-alpine ARG NEXT_PUBLIC_VERSION ENV NEXT_PUBLIC_VERSION=$NEXT_PUBLIC_VERSION +ARG NEXT_PUBLIC_CLARITY_PROJECT_ID +ENV NEXT_PUBLIC_CLARITY_PROJECT_ID=$NEXT_PUBLIC_CLARITY_PROJECT_ID RUN apk add --no-cache g++ make py3-pip bash nginx RUN adduser -D -g 'www' www RUN mkdir -p /home/www && chown -R www:www /home/www