2024-01-07 17:18:52 +00:00
|
|
|
FROM node:20-alpine as base
|
2023-09-13 21:08:44 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# Build layer
|
|
|
|
FROM base as build
|
|
|
|
|
2023-09-14 18:19:07 +00:00
|
|
|
RUN npm i -g pnpm
|
|
|
|
COPY pnpm-lock.yaml package.json ./
|
|
|
|
RUN pnpm install --frozen-lockfile
|
2023-09-13 21:08:44 +00:00
|
|
|
COPY . .
|
2023-09-14 18:19:07 +00:00
|
|
|
RUN pnpm build
|
2023-09-13 21:08:44 +00:00
|
|
|
|
|
|
|
# Production layer
|
|
|
|
FROM base as production
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
COPY --from=build /app/.output ./.output
|
|
|
|
|
|
|
|
CMD ["node", ".output/server/index.mjs"]
|