Skip to content

fix: Tiny docker build cache optimization#4280

Open
Axodouble wants to merge 1 commit intoDokploy:canaryfrom
Axodouble:fix/docker-cache-improvement
Open

fix: Tiny docker build cache optimization#4280
Axodouble wants to merge 1 commit intoDokploy:canaryfrom
Axodouble:fix/docker-cache-improvement

Conversation

@Axodouble
Copy link
Copy Markdown
Contributor

@Axodouble Axodouble commented Apr 22, 2026

What is this PR about?

Please describe in a short paragraph what this PR is about.

This is a tiny 2 line change that moves where & when the build layer in docker installs the changes, this should make development a bit faster as you are able to at least cache the apt changes.

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)

Screenshots (if applicable)

Greptile Summary

This PR reorders the apt-get install step in the build stage to appear before COPY . /usr/src/app, so the system-dependency layer is cached and not rebuilt on every source change. The reordering is correct and the Dockerfile remains valid.

Confidence Score: 5/5

Safe to merge — the change is a correct and standard Dockerfile layer-ordering optimization with no functional impact.

Only finding is a P2 suggestion for a deeper cache optimization (copy manifests before full source). The change as written is correct, builds will not break, and the cache benefit is real.

No files require special attention.

Reviews (1): Last reviewed commit: "fix: Reorder when apt updates and instal..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@Axodouble Axodouble requested a review from Siumauricio as a code owner April 22, 2026 07:21
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 22, 2026
Comment thread Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant