add dockerfile
This commit is contained in:
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM node:alpine AS base
|
||||
|
||||
RUN corepack enable
|
||||
RUN corepack prepare pnpm@latest --activate
|
||||
|
||||
|
||||
FROM base as dependencies
|
||||
|
||||
WORKDIR /app
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install
|
||||
|
||||
|
||||
FROM base as build
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
COPY --from=dependencies /app/node_modules ./node_modules
|
||||
RUN pnpm build
|
||||
RUN pnpm prune --prod
|
||||
|
||||
|
||||
FROM base as deploy
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/dist ./dist
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
|
||||
|
||||
CMD ["node", "."]
|
||||
Reference in New Issue
Block a user