Skip to content

Instantly share code, notes, and snippets.

@o-az
Last active February 25, 2023 11:28
Show Gist options
  • Select an option

  • Save o-az/634545376fd13fc1fc882cc4a664289c to your computer and use it in GitHub Desktop.

Select an option

Save o-az/634545376fd13fc1fc882cc4a664289c to your computer and use it in GitHub Desktop.
FROM node:lts-alpine AS builder
ARG PNPM_HOME="/root/.local/share/pnpm"
ARG PATH="${PATH}:${PNPM_HOME}"
WORKDIR /app
COPY . .
RUN npx --yes pnpm add --global pnpm@latest && \
pnpm install --frozen-lockfile && \
pnpm build
FROM gcr.io/distroless/nodejs18-debian11
ARG PORT=3004
WORKDIR /app
COPY --from=builder /app/dist/index.cjs index.cjs
#
# Distroless image has `ENTRYPOINT` set to `node` by default,
# So we don't need to specify `node` here.
CMD [ "index.cjs" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment