mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
feat: update Dockerfile for pnpm support, enable registry switching, and remove unused packages
This commit is contained in:
parent
74add79c8f
commit
3069b5cfc3
4
.npmrc
Normal file
4
.npmrc
Normal file
@ -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
Dockerfile
18
Dockerfile
@ -1,20 +1,20 @@
|
|||||||
FROM node:18-alpine AS base
|
FROM node:20-alpine AS base
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
|
|
||||||
RUN apk add --no-cache libc6-compat
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json yarn.lock ./
|
COPY .npmrc package.json pnpm-lock.yaml ./
|
||||||
|
|
||||||
RUN yarn config set registry 'https://registry.npmmirror.com/'
|
RUN pnpm install
|
||||||
RUN yarn install
|
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
|
|
||||||
RUN apk update && apk add --no-cache git
|
|
||||||
|
|
||||||
ENV OPENAI_API_KEY=""
|
ENV OPENAI_API_KEY=""
|
||||||
ENV GOOGLE_API_KEY=""
|
ENV GOOGLE_API_KEY=""
|
||||||
ENV CODE=""
|
ENV CODE=""
|
||||||
@ -23,7 +23,7 @@ WORKDIR /app
|
|||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN yarn build
|
RUN pnpm build
|
||||||
|
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
Loading…
Reference in New Issue
Block a user