Skip to content

fix(docker): isolate build database configuration - #490

Merged
Producdevity merged 1 commit into
masterfrom
staging
Sep 23, 2026
Merged

Producdevity merged 1 commit into
masterfrom
staging

Conversation

@Producdevity

@Producdevity Producdevity commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Description

Separate Docker build database configuration from the application's runtime database URLs. Prisma generation now requires BUILD_DATABASE_URL for a migrated disposable database, while the real Supabase URLs remain runtime-only in Coolify. Exclude backups from the Docker context and document the build/runtime configuration.

Type of change

  • Bug fix
  • Documentation update

How Has This Been Tested?

  • GitHub CI lint and type-check passed for 212928376089863f095054a8c2e15a97050347f9.
  • GitHub CI unit tests and production build passed for that commit.
  • The September 3 Coolify staging deployment succeeded using an isolated schema-only build database; readiness passed and build credentials were absent at runtime.

Checklist

  • Reviewed the complete three-file diff.
  • Updated the hosting documentation.
  • Confirmed the existing commit checks passed; fresh PR checks remain to be verified.

Notes for reviewers

Coolify must have BUILD_DATABASE_URL configured as build-only before deploying this commit. The staging and production build databases have been prepared separately. This PR changes no application API contracts or database schema; DNS cutover is a separate operation.


Summary by cubic

Separates Docker build-time database configuration from runtime database URLs so build credentials no longer leak into image metadata.

  • Prisma generation now uses BUILD_DATABASE_URL (and optional BUILD_DATABASE_DIRECT_URL) pointing to a migrated, disposable database; the build fails if it's missing.
  • Backups are excluded from the Docker context.
  • Hosting docs updated for the build/runtime split and the build-only variables.

Migration

  • Coolify must set BUILD_DATABASE_URL as a build-only variable before deploying this commit; prepare the staging and production build databases separately.

Written for commit 2129283. Summary will update on new commits.

Review in cubic

@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
emuready Ready Ready Preview Sep 23, 2026 7:21am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 508af350-856b-4801-941e-fb65ab403974

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T07:24:38.246096Z 2129283 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2129283760

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Dockerfile
ENV NEXT_TELEMETRY_DISABLED=1
RUN pnpm version:sync
RUN DATABASE_URL="${DATABASE_URL}" DATABASE_DIRECT_URL="${DATABASE_DIRECT_URL:-${DATABASE_URL}}" \
RUN : "${BUILD_DATABASE_URL:?Set BUILD_DATABASE_URL to a migrated disposable database}" && \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Consume the database URL as a BuildKit secret

When operators follow the new self-hosting instructions and enable Use Docker Build Secrets, BUILD_DATABASE_URL is supplied as a BuildKit secret rather than as this declared build argument. Docker requires secrets to be consumed by a RUN --mount=type=secret instruction (Docker build secrets); this RUN therefore sees an empty BUILD_DATABASE_URL and aborts every Coolify app build before pnpm build. Mount the secret into this instruction, or do not instruct operators to enable secret mode.

Useful? React with 👍 / 👎.

@Producdevity
Producdevity merged commit a6d22c8 into master Sep 23, 2026
28 checks passed

This branch was successfully deployed

1 active deployment
staging — 21292837 Deployed Sep 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant