personal-website/Dockerfile

25 lines
439 B
Docker
Raw Normal View History

2024-07-07 22:49:39 +02:00
FROM node:lts-slim AS base
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 22:49:39 +02:00
FROM base AS prod-deps
RUN pnpm install --omit=dev
2024-07-07 22:49:39 +02:00
FROM base AS build-deps
RUN pnpm install
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 22:49:39 +02:00
ENV HOST=0.0.0.0
ENV PORT=4321
EXPOSE 4321
2024-07-07 22:49:39 +02:00
CMD node ./dist/server/entry.mjs