Created
November 20, 2023 23:03
-
-
Save hahouari/e57cb8c5fc6e0fb97b59ef8a1a5e13bf to your computer and use it in GitHub Desktop.
Dockerfile for Sveltekit with pnpm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:20-slim AS base | |
ENV PNPM_HOME="/pnpm" | |
ENV PATH="$PNPM_HOME:$PATH" | |
RUN corepack enable | |
COPY . /app | |
WORKDIR /app | |
FROM base AS prod-deps | |
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | |
FROM base AS build | |
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | |
RUN pnpm run check | |
RUN pnpm run build | |
FROM base | |
COPY --from=prod-deps /app/node_modules /app/node_modules | |
COPY --from=build /app/.svelte-kit /app/.svelte-kit | |
CMD [ "pnpm", "run", "preview" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment