personal-website/Dockerfile
Cyril Šebek 8bb3e17a3b
Some checks failed
Build Docker Image and Deploy / Build Image and push to Registry (push) Failing after 37s
Build Docker Image and Deploy / Deploy on webserver (push) Has been skipped
Optimisations
2024-07-07 22:49:39 +02:00

25 lines
439 B
Docker

FROM node:lts-slim AS base
WORKDIR /app
RUN corepack enable pnpm
COPY package.json pnpm-lock.yaml ./
FROM base AS prod-deps
RUN pnpm install --omit=dev
FROM base AS build-deps
RUN pnpm install
FROM build-deps AS build
COPY . .
RUN pnpm run build
FROM base AS runtime
COPY --from=prod-deps /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
ENV HOST=0.0.0.0
ENV PORT=4321
EXPOSE 4321
CMD node ./dist/server/entry.mjs