chore: added Docker
This commit is contained in:
parent
926971aa91
commit
ae1fda71a8
1 changed files with 40 additions and 0 deletions
40
Dockerfile
Normal file
40
Dockerfile
Normal file
|
@ -0,0 +1,40 @@
|
|||
|
||||
FROM node:18-alpine AS base
|
||||
|
||||
RUN npm i -g pnpm
|
||||
|
||||
FROM base AS dependencies
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
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/build ./build
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
COPY --from=build /app/package.json ./package.json
|
||||
|
||||
ARG PORT=3000
|
||||
|
||||
ENV NODE_ENV=production PORT=$PORT
|
||||
|
||||
EXPOSE $PORT
|
||||
|
||||
CMD ["node", "build"]
|
Loading…
Add table
Reference in a new issue