Skip to content

Commit

Permalink
fix: 优化容器部署启动速度
Browse files Browse the repository at this point in the history
  • Loading branch information
besscroft committed May 22, 2024
1 parent 7190b5c commit 9f32616
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 33 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ COPY package.json pnpm-lock.yaml* .npmrc ./

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

FROM base AS runner-base

RUN apk add --no-cache libc6-compat

WORKDIR /app

RUN corepack enable pnpm && pnpm add prisma @prisma/client

FROM base AS builder

WORKDIR /app
Expand All @@ -29,6 +37,7 @@ ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=runner-base /app/node_modules ./node_modules
COPY --from=builder /app/public ./public
COPY ./prisma ./prisma
COPY ./script.sh ./script.sh
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@aws-sdk/client-s3": "^3.574.0",
"@douyinfe/semi-ui": "^2.58.0",
"@nextui-org/react": "^2.3.6",
"@prisma/client": "^5.13.0",
"@prisma/client": "^5.14.0",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
Expand Down Expand Up @@ -64,7 +64,7 @@
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.3",
"postcss": "^8.4.38",
"prisma": "^5.13.0",
"prisma": "^5.14.0",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5"
}
Expand Down
62 changes: 31 additions & 31 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f32616

Please sign in to comment.