mirror of
https://github.com/cupcakearmy/blaze.git
synced 2024-12-22 00:06:26 +00:00
24 lines
580 B
Docker
24 lines
580 B
Docker
FROM node:20-slim AS base
|
|
ENV CI=true
|
|
ENV PNPM_HOME="/pnpm"
|
|
ENV PATH="$PNPM_HOME:$PATH"
|
|
RUN corepack enable
|
|
WORKDIR /app
|
|
COPY package.json pnpm-lock.yaml ./
|
|
|
|
FROM base AS prod-deps
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod
|
|
|
|
FROM base AS build
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install
|
|
COPY . /app
|
|
RUN pnpm run build
|
|
|
|
FROM base
|
|
ENV NODE_ENV=production
|
|
COPY --from=prod-deps /app/node_modules /app/node_modules
|
|
COPY --from=build /app/dist /app/dist
|
|
COPY --from=build /app/templates /app/templates
|
|
EXPOSE 8000
|
|
CMD [ "pnpm", "start" ]
|