Skip to content

Commit

Permalink
fix: install latest corepack globally and upgrade pnpm (#1493)
Browse files Browse the repository at this point in the history
  • Loading branch information
book000 authored Feb 9, 2025
1 parent a918b4e commit ed840e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"otherPortsAttributes": {
"onAutoForward": "silent"
},
"postCreateCommand": "sudo npm uninstall -g pnpm yarn && sudo git config --system --add safe.directory ${containerWorkspaceFolder} && sudo chown node node_modules .pnpm-store && sudo corepack enable && corepack install && pnpm install",
"postCreateCommand": "sudo npm uninstall -g pnpm yarn && sudo git config --system --add safe.directory ${containerWorkspaceFolder} && sudo chown node node_modules .pnpm-store && sudo npm install -g corepack@latest && sudo corepack enable && corepack install && pnpm install && pnpm approve-builds",
"waitFor": "postCreateCommand",
"mounts": [
"source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ RUN apk update && \
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \
echo "Asia/Tokyo" > /etc/timezone && \
apk del tzdata && \
npm install -g corepack@latest && \
pnpm approve-builds && \
corepack enable

WORKDIR /app
Expand All @@ -21,7 +23,8 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm fetch
COPY package.json tsconfig.json ./
COPY src src

RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --offline
RUN --mount=type=cache,id=npm,target=/pnpm/store pnpm install --frozen-lockfile --offline && \
pnpm approve-builds

ENV NODE_ENV=production
ENV CONFIG_PATH=/data/config.json
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,10 @@
"tsx": "4.19.2",
"typescript": "5.7.3"
},
"packageManager": "pnpm@10.2.1"
"packageManager": "pnpm@10.2.1+sha512.398035c7bd696d0ba0b10a688ed558285329d27ea994804a52bad9167d8e3a72bcb993f9699585d3ca25779ac64949ef422757a6c31102c12ab932e5cbe5cc92",
"pnpm": {
"onlyBuiltDependencies": [
"esbuild"
]
}
}

0 comments on commit ed840e6

Please sign in to comment.