Skip to content

fix: invalidate railpack build cache when env changes#4557

Draft
rnkp755 wants to merge 1 commit into
Dokploy:canaryfrom
rnkp755:fix/env-update-issue
Draft

fix: invalidate railpack build cache when env changes#4557
rnkp755 wants to merge 1 commit into
Dokploy:canaryfrom
rnkp755:fix/env-update-issue

Conversation

@rnkp755
Copy link
Copy Markdown

@rnkp755 rnkp755 commented Jun 6, 2026

What is this PR about?

Fix Railpack application rebuilds so environment variable changes are reflected without requiring Clean Cache or Docker cache pruning.

Railpack builds pass application env vars as BuildKit secrets, but BuildKit secrets do not reliably invalidate cached layers by themselves. Previously, Dokploy only passed the secrets-hash build arg when cleanCache was enabled, so regular rebuilds could reuse stale cached output after env vars changed.

This PR always passes a hash of the resolved environment variables to the Railpack Docker build. The normal build cache is still used when env vars do not change, while env changes now invalidate the relevant cached build output.

Checklist

Before submitting this PR, please make sure that:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

Issues related (if applicable)

closes #4516

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.

Environment variables not changing after rebuild

1 participant