gists/Dofckerfile sveltekit node.md

25 lines
479 B
Markdown
Raw Normal View History

2024-12-12 13:22:26 +01:00
FROM node:22-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
# Fetch dependencies
FROM base AS install
COPY pnpm-lock.yaml ./
RUN pnpm fetch
COPY . .
2024-12-12 13:26:51 +01:00
# Install production dependencies
2024-12-12 13:25:58 +01:00
RUN pnpm install --offline --prod --frozen-lockfile
2024-12-12 13:22:26 +01:00
2024-12-12 13:26:51 +01:00
# Install dev dependencies (needed for the build step)
2024-12-12 13:25:58 +01:00
RUN pnpm install --offline --frozen-lockfile
2024-12-12 13:22:26 +01:00
# Build
ENV NODE_ENV=production
RUN pnpm build
ENTRYPOINT ["node", "build"]
EXPOSE 3000