feat: optimize Dockerfile #288

Closed
opened 2026-04-05 16:17:16 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @duhow on 8/16/2025

  • Introduced a base stage to centralize shared dependencies and setup, reducing duplication in Dockerfile between build and production stages. The BASE_IMAGE argument allows for easier updates to the base Node.js image, and can be used to change base images to build and run.
  • Updated dependency installation commands to use build cache mounts for both npm and pnpm, improving build performance by leveraging cached dependencies.
    • This can reduce build time if using cache-from and/or cache-to in docker build actions.
  • Make the entrypoint script already executable, so chmod is no longer needed, avoids file duplication and a extra (unuseful) layer.
*Originally created by @duhow on 8/16/2025* * Introduced a `base` stage to centralize shared dependencies and setup, reducing duplication in `Dockerfile` between build and production stages. The `BASE_IMAGE` argument allows for easier updates to the base Node.js image, and can be used to change base images to build and run. * Updated dependency installation commands to use build `cache` mounts for both npm and pnpm, improving build performance by leveraging cached dependencies. * This can reduce build time if using `cache-from` and/or `cache-to` in `docker build` actions. * Make the entrypoint script already `executable`, so `chmod` is no longer needed, avoids file duplication and a extra (unuseful) layer.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OpenArchiver#288