-
-
Notifications
You must be signed in to change notification settings - Fork 598
Add cache mounts to docker files #1452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2f892e6
74a03e6
a70ee42
0b0871b
a0813d4
4c3d763
d0c742f
5023cc9
eee5fc6
c541322
3be4c59
bd1bcde
9d46437
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,15 @@ FROM node:23-alpine | |
|
|
||
| WORKDIR /opt/node | ||
|
|
||
| ENV PNPM_HOME="/pnpm" | ||
| ENV NPM_CONFIG_RETRY=5 \ | ||
| NPM_CONFIG_TIMEOUT=30000 \ | ||
| PATH="$PNPM_HOME:$PATH" | ||
|
|
||
| COPY package.json pnpm-lock.yaml ./ | ||
|
|
||
| RUN npm install --ignore-scripts -g pnpm && \ | ||
| RUN npm install --ignore-scripts -g pnpm | ||
| RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ | ||
| pnpm install --frozen-lockfile --ignore-scripts | ||
|
Comment on lines
+13
to
14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure cache mount aligns with pnpm’s actual store directory Update the install command to direct pnpm’s store into your cache mount: RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
- pnpm install --frozen-lockfile --ignore-scripts
+ pnpm install --frozen-lockfile --ignore-scripts --store-dir=/pnpm/storeAlternatively, set it globally before installation: RUN pnpm config set store-dir=/pnpm/storeThis ensures the cache mount is effective and speeds up subsequent builds. 🤖 Prompt for AI Agents (early access) |
||
|
|
||
| WORKDIR /nest | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,7 @@ psycopg | |
| pygithub | ||
| pygoat | ||
| pymdownx | ||
| pypoetry | ||
| pyyaml | ||
| repositorycontributor | ||
| requirepass | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Pin pnpm version for reproducible builds
Installing the latest pnpm without a version specifier can lead to unpredictable build failures when a new pnpm release is published.
Consider pinning pnpm to a known stable version, for example:
RUN npm install --ignore-scripts -g pnpm +RUN npm install --ignore-scripts -g pnpm@8.8.0You can bump the
@8.8.0to whichever version aligns with your team’s compatibility requirements.📝 Committable suggestion
🤖 Prompt for AI Agents (early access)