2024-07-07 22:49:39 +02:00
|
|
|
FROM node:lts-slim AS base
|
2024-07-07 20:33:35 +02:00
|
|
|
WORKDIR /app
|
|
|
|
|
2024-07-07 21:26:11 +02:00
|
|
|
RUN corepack enable pnpm
|
|
|
|
|
2024-07-07 22:49:39 +02:00
|
|
|
COPY package.json pnpm-lock.yaml ./
|
2024-07-07 20:33:35 +02:00
|
|
|
|
2024-07-07 22:49:39 +02:00
|
|
|
FROM base AS prod-deps
|
2024-07-07 22:52:09 +02:00
|
|
|
RUN pnpm install --prod
|
2024-07-07 20:33:35 +02:00
|
|
|
|
2024-07-07 22:49:39 +02:00
|
|
|
FROM base AS build-deps
|
|
|
|
RUN pnpm install
|
2024-07-07 20:33:35 +02:00
|
|
|
|
2024-07-07 22:49:39 +02:00
|
|
|
FROM build-deps AS build
|
|
|
|
COPY . .
|
|
|
|
RUN pnpm run build
|
2024-07-07 21:36:37 +02:00
|
|
|
|
2024-07-07 22:49:39 +02:00
|
|
|
FROM base AS runtime
|
|
|
|
COPY --from=prod-deps /app/node_modules ./node_modules
|
|
|
|
COPY --from=build /app/dist ./dist
|
2024-07-07 20:33:35 +02:00
|
|
|
|
2024-07-07 22:49:39 +02:00
|
|
|
ENV HOST=0.0.0.0
|
|
|
|
ENV PORT=4321
|
2024-07-07 20:33:35 +02:00
|
|
|
EXPOSE 4321
|
2024-07-07 22:49:39 +02:00
|
|
|
CMD node ./dist/server/entry.mjs
|