From 3c3d27b35c24c773fb95f6b393ea3ef38e0c2577 Mon Sep 17 00:00:00 2001 From: pavel444-byte Date: Wed, 14 Oct 2026 16:37:47 +0500 Subject: [PATCH] Clarify Dokploy build-time Supabase configuration --- Dockerfile | 2 +- docs/dokploy-deployment.md | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8a725b0..d44075c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ ENV NODE_ENV=production \ NEXT_PUBLIC_SUPABASE_URL=${NEXT_PUBLIC_SUPABASE_URL} \ NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=${NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY} RUN if [ -z "$NEXT_PUBLIC_SUPABASE_URL" ] || [ -z "$NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY" ]; then \ - echo "Pass NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY as Docker build arguments." >&2; \ + echo "In Dokploy, set NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY under Application > Environment > Build Time Arguments." >&2; \ exit 1; \ fi && npm run build diff --git a/docs/dokploy-deployment.md b/docs/dokploy-deployment.md index b69d46c..69d863a 100644 --- a/docs/dokploy-deployment.md +++ b/docs/dokploy-deployment.md @@ -17,12 +17,22 @@ provider, create a separate application and move the domain after its first successful deployment. Configure its build type as **Dockerfile**, with the Dockerfile and build context both at the repository root. -Set these Docker build arguments in the Dokploy application: +In the Dokploy application, open **Environment** and add both values under +**Build Time Arguments** (not only under the regular runtime environment +variables): -- `NEXT_PUBLIC_SUPABASE_URL` -- `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY` +```text +NEXT_PUBLIC_SUPABASE_URL= +NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY= +``` -Set the required runtime environment values in Dokploy as well: +These values are used by Next.js while compiling browser code. Setting them +only as runtime environment variables does not populate Dockerfile `ARG` +values, which causes the build error that says they were empty. Both values +are public client configuration; do not put `SUPABASE_SECRET_KEY` in Build +Time Arguments. + +Also set the following in Dokploy's regular runtime environment: - `NEXT_PUBLIC_SUPABASE_URL` - `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY`