Clarify Dokploy build-time Supabase configuration
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 9m12s

This commit is contained in:
2026-10-14 16:37:47 +05:00
parent 1637ad922e
commit 3c3d27b35c
2 changed files with 15 additions and 5 deletions

View File

@@ -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

View File

@@ -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=<your Supabase project URL>
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=<your 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`