Skip to content

Commit 49f70bc

Browse files
waleedlatif1claude
andauthored
fix(docker): restore NEXT_PUBLIC_APP_URL build arg with dummy fallback (#4665)
* fix(docker): restore NEXT_PUBLIC_APP_URL build arg with dummy fallback getBaseUrl() in lib/core/utils/urls is evaluated at module load during next build's page-data collection and throws if NEXT_PUBLIC_APP_URL is unset. PR #4658 removed the build arg, breaking the Docker build at the "/_not-found" page-data collection step. Restore the dummy localhost fallback (mirroring DATABASE_URL). The CORS fix from #4658 is preserved: next.config.ts no longer reads NEXT_PUBLIC_APP_URL at build time, and no module-level expression captures getBaseUrl() — every caller invokes it at request time, where getEnv() reads the deployed container env. The dummy localhost value cannot leak into runtime CORS response headers. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore(docker): trim verbose comment on build-time env args Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6414b93 commit 49f70bc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

docker/app.Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,13 @@ ENV NEXT_TELEMETRY_DISABLED=1 \
6969
VERCEL_TELEMETRY_DISABLED=1 \
7070
DOCKER_BUILD=1
7171

72-
# Provide dummy database URLs during image build so server code that imports @sim/db
73-
# can be evaluated without crashing. Runtime environments should override these.
72+
# Dummy values so next build can evaluate modules. Override at runtime.
7473
ARG DATABASE_URL="postgresql://user:pass@localhost:5432/dummy"
7574
ENV DATABASE_URL=${DATABASE_URL}
7675

76+
ARG NEXT_PUBLIC_APP_URL="http://localhost:3000"
77+
ENV NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
78+
7779
# Per-platform cache id keeps arm64/amd64 SWC artifacts isolated.
7880
RUN --mount=type=cache,id=next-cache-${TARGETPLATFORM},target=/app/apps/sim/.next/cache \
7981
--mount=type=cache,id=turbo-cache-${TARGETPLATFORM},target=/app/.turbo \

0 commit comments

Comments
 (0)