File tree Expand file tree Collapse file tree
packages/aws-ecr-publish/plugins Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,39 +28,20 @@ module.exports = [
2828 ) ,
2929 Dockerfile : dedent `
3030 ARG NODE_VERSION=24
31- FROM node:\${NODE_VERSION} AS build
32-
33- WORKDIR /usr/app
34-
35- ARG NPM_TOKEN
36-
37- # Project uses private NPM modules. Pass in NPM token externally.
38- # Tell NPM to use the token from the environment variable
39- RUN npm config set --location global \
40- "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" \
41- "registry=https://registry.npmjs.org/"
42-
43- ARG NODE_ENV=production
44- ENV NODE_ENV=$NODE_ENV
45- COPY package.json pnpm-lock.yaml /usr/app/
46- RUN corepack enable && pnpm i --production --frozen-lockfile
47-
48- # Build the final image
4931 FROM node:\${NODE_VERSION}
5032
5133 WORKDIR /usr/app
5234
5335 ARG NODE_ENV=production
5436 ENV NODE_ENV=$NODE_ENV
37+ COPY package.json pnpm-lock.yaml /usr/app/
38+ RUN --mount=type=secret,id=npmrc,target=/usr/app/.npmrc \
39+ corepack enable && pnpm i --production --frozen-lockfile
5540
5641 EXPOSE 80
5742
58- COPY --from=build /usr/app/node_modules /usr/app/node_modules/
59- COPY --from=build /usr/app/package.json /usr/app/pnpm-lock.yaml /usr/app/
6043 COPY src/ /usr/app/src/
6144
62- ENV PORT=80
63-
6445 RUN ["node", "src/index.ts"]
6546 ` ,
6647 }
You can’t perform that action at this time.
0 commit comments