Skip to content

Commit

Permalink
Merge pull request #187 from zeabur/pan93412/ZEA-2394-corepack-for-no…
Browse files Browse the repository at this point in the history
…de-12

ZEA-2394: add corepack support for Node.js 12
  • Loading branch information
Yuanlin Lin authored Jan 15, 2024
2 parents 8a775d0 + 3b43319 commit 3d622f0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
18 changes: 18 additions & 0 deletions internal/nodejs/__snapshots__/template_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ FROM node:18 as build
ENV PORT=8080
WORKDIR /src

# Check if we have 'corepack' available; if none, we
# install corepack@0.10.0.
RUN which corepack || npm install -g --force corepack@0.10.0
RUN corepack enable

RUN yarn install
Expand All @@ -25,6 +28,9 @@ FROM node:18 as build
ENV PORT=8080
WORKDIR /src

# Check if we have 'corepack' available; if none, we
# install corepack@0.10.0.
RUN which corepack || npm install -g --force corepack@0.10.0
RUN corepack enable

RUN yarn install
Expand All @@ -45,6 +51,9 @@ FROM node:18 as build
ENV PORT=8080
WORKDIR /src

# Check if we have 'corepack' available; if none, we
# install corepack@0.10.0.
RUN which corepack || npm install -g --force corepack@0.10.0
RUN corepack enable

RUN yarn install
Expand All @@ -65,6 +74,9 @@ FROM node:18 as build
ENV PORT=8080
WORKDIR /src

# Check if we have 'corepack' available; if none, we
# install corepack@0.10.0.
RUN which corepack || npm install -g --force corepack@0.10.0
RUN corepack enable

RUN yarn install
Expand All @@ -85,6 +97,9 @@ FROM node:18 as build
ENV PORT=8080
WORKDIR /src

# Check if we have 'corepack' available; if none, we
# install corepack@0.10.0.
RUN which corepack || npm install -g --force corepack@0.10.0
RUN corepack enable

RUN yarn install
Expand All @@ -111,6 +126,9 @@ WORKDIR /src
COPY --from=bun-runtime /usr/local/bin/bun /usr/local/bin
COPY --from=bun-runtime /usr/local/bin/bunx /usr/local/bin

# Check if we have 'corepack' available; if none, we
# install corepack@0.10.0.
RUN which corepack || npm install -g --force corepack@0.10.0
RUN corepack enable

RUN bun install
Expand Down
3 changes: 3 additions & 0 deletions internal/nodejs/templates/template.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ COPY --from=bun-runtime /usr/local/bin/bun /usr/local/bin
COPY --from=bun-runtime /usr/local/bin/bunx /usr/local/bin
{{- end }}

# Check if we have 'corepack' available; if none, we
# install [email protected].
RUN which corepack || npm install -g --force [email protected]
RUN corepack enable

{{ .InstallCmd }}
Expand Down

0 comments on commit 3d622f0

Please sign in to comment.