24 lines
540 B
Docker
24 lines
540 B
Docker
FROM node:20.10.0 as dependencies
|
|
WORKDIR /app
|
|
COPY package.json yarn.lock ./
|
|
RUN yarn install --frozen-lockfile
|
|
|
|
FROM node:20.10.0 as builder
|
|
WORKDIR /app
|
|
COPY . .
|
|
COPY --from=dependencies /app/node_modules ./node_modules
|
|
RUN yarn build
|
|
|
|
FROM node:20.10.0 as runner
|
|
WORKDIR /app
|
|
COPY . .
|
|
|
|
ENV NODE_ENV production
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder /app/package.json ./package.json
|
|
COPY --from=builder /app/.next ./.next
|
|
COPY --from=dependencies /app/node_modules ./node_modules
|
|
|
|
EXPOSE 4200
|
|
CMD ["yarn", "start"]
|