Skip to content

Commit

Permalink
feat: update Dockerfile for pnpm support, enable registry switching, …
Browse files Browse the repository at this point in the history
…and remove unused packages
  • Loading branch information
DDDDD12138 committed Sep 21, 2024
1 parent 74add79 commit 3069b5c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# if you located in China, you can use taobao registry to speed up.
# You can also specify your own private npm registry, which will be effective in local development, deployment, and Docker environments.

# registry=https://registry.npmmirror.com/
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
FROM node:18-alpine AS base
FROM node:20-alpine AS base

FROM base AS deps
# if you located in China, you can use taobao registry to speed up
# RUN npm config set registry 'https://registry.npmmirror.com/'

RUN npm install -g pnpm@latest-9

RUN apk add --no-cache libc6-compat
FROM base AS deps

WORKDIR /app

COPY package.json yarn.lock ./
COPY .npmrc package.json pnpm-lock.yaml ./

RUN yarn config set registry 'https://registry.npmmirror.com/'
RUN yarn install
RUN pnpm install

FROM base AS builder

RUN apk update && apk add --no-cache git

ENV OPENAI_API_KEY=""
ENV GOOGLE_API_KEY=""
ENV CODE=""
Expand All @@ -23,7 +23,7 @@ WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

RUN yarn build
RUN pnpm build

FROM base AS runner
WORKDIR /app
Expand Down

0 comments on commit 3069b5c

Please sign in to comment.