Skip to content
Discussion options

You must be logged in to vote

I managed to achieve this with the following Dockerfile

FROM node:22 AS pre-builder
WORKDIR /app
ADD ./ ./
RUN yarn install --pure-lockfile
RUN yarn build

FROM node:22 AS builder
WORKDIR /app
COPY --chown=node:node --from=pre-builder /app/server ./
RUN yarn install --pure-lockfile

FROM node:22
WORKDIR /app
COPY --chown=node:node --from=builder /app ./
CMD ["yarn", "start"]
EXPOSE 8080

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ThomasKientz
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by bloodyowl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants