Skip to content

Commit 96918ef

Browse files
authored
Merge pull request #13 from yoziru/update-yarn-v2
upgrade to yarn v2+
2 parents 1b766de + 1010390 commit 96918ef

File tree

6 files changed

+7231
-4854
lines changed

6 files changed

+7231
-4854
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Dockerfile
77
Makefile
88
.github
99
.git
10+
.yarn

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/node_modules
55
/.pnp
66
.pnp.js
7-
.yarn/install-state.gz
7+
.yarn
88

99
# testing
1010
/coverage

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ ARG NODE_VERSION=lts
33
FROM node:$NODE_VERSION-alpine AS builder
44
ENV YARN_CACHE_FOLDER=/opt/yarncache
55
WORKDIR /opt/app
6-
COPY package.json yarn.lock ./
7-
RUN yarn install --frozen-lockfile
6+
COPY package.json yarn.lock .yarnrc.yml .yarn/ ./
7+
RUN corepack enable && yarn install --immutable
88
# patch logging for requestHandler
99
RUN sed -Ei \
1010
-e '/await requestHandler/iconst __start = new Date;' \
@@ -40,6 +40,12 @@ RUN chown nextjs:nodejs .next
4040
COPY --from=builder --chown=nextjs:nodejs /opt/app/.next/standalone ./
4141
COPY --from=builder --chown=nextjs:nodejs /opt/app/.next/static ./.next/static
4242

43+
# Copy Yarn Berry files for runtime (if needed for PnP or CLI usage)
44+
COPY --from=builder /opt/app/.yarnrc.yml ./
45+
COPY --from=builder /opt/app/.yarn ./.yarn
46+
COPY --from=builder /opt/app/package.json ./
47+
COPY --from=builder /opt/app/yarn.lock ./
48+
4349
USER nextjs
4450

4551
EXPOSE 3000

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@
4949
"typescript": "^5.4.3",
5050
"typescript-eslint": "^7.4.0"
5151
},
52-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
52+
"packageManager": "yarn@4.9.1"
5353
}

0 commit comments

Comments
 (0)