Skip to content

Commit

Permalink
chore: optimize Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
star0202 committed Jul 19, 2023
1 parent 4cd1990 commit a949fcd
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
FROM node:19-alpine
FROM node:19-alpine AS builder

WORKDIR /app

COPY package.json pnpm-lock.yaml ./

RUN corepack enable && pnpm i
RUN corepack enable && pnpm i --frozen-lockfile

COPY tsconfig.json ./
COPY src src

RUN pnpm build

COPY . .
FROM node:19-alpine

WORKDIR /app

RUN pnpm run build
COPY --from=builder /app ./

EXPOSE 3000
RUN corepack enable

CMD ["pnpm", "start"]

0 comments on commit a949fcd

Please sign in to comment.