From 4fc3de5c5563e617bf273e33e488bc81ebe9b77d Mon Sep 17 00:00:00 2001 From: sijinhui Date: Wed, 8 May 2024 11:37:50 +0800 Subject: [PATCH] package --- .github/workflows/dockerToHub.yml | 2 +- Dockerfile | 13 ++++----- app/constant.ts | 45 +++++++++++++------------------ app/store/config.ts | 4 +-- start.sh | 14 +++++----- 5 files changed, 36 insertions(+), 42 deletions(-) diff --git a/.github/workflows/dockerToHub.yml b/.github/workflows/dockerToHub.yml index fdb730139..c25ab63ff 100644 --- a/.github/workflows/dockerToHub.yml +++ b/.github/workflows/dockerToHub.yml @@ -30,7 +30,7 @@ jobs: echo ${{ secrets.ALY_DOCKER_PASSWORD }} | docker login registry.cn-hangzhou.aliyuncs.com -u ${{ secrets.ALY_DOCKER_USERNAME }} --password-stdin echo "${{ secrets.DOCKER_ENV }}" > .env bash ./start.sh - docker-compose build + #docker-compose build docker-compose push yes | docker system prune --filter "until=168h" download-repo: diff --git a/Dockerfile b/Dockerfile index f6d6b2712..9b9f74efa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,17 +14,18 @@ ENV TZ=Asia/Chongqing RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone FROM base AS deps -RUN apk add --no-cache libc6-compat g++ make + +RUN apk add --no-cache libc6-compat WORKDIR /app -COPY package.json ./ +COPY package.json yarn.lock ./ -#RUN yarn config set registry 'https://registry.npmmirror.com/' -#RUN yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp" -#RUN yarn config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips" +RUN yarn config set registry 'https://registry.npmmirror.com/' +RUN yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp" +RUN yarn config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips" #RUN # 清理遗留的缓存 -RUN yarn cache clean +#RUN yarn cache clean RUN yarn install FROM base AS builder diff --git a/app/constant.ts b/app/constant.ts index 7aac19a31..bb3c9712b 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -228,22 +228,8 @@ export const DEFAULT_MODELS = [ // providerType: "openai", // }, // }, - // { - // name: "gpt-4-turbo-2024-04-09", - // available: true, - // provider: { - // id: "openai", - // providerName: "OpenAI", - // providerType: "openai", - // }, - // }, - // { - // name: "gpt-4", - // describe: "GPT-4,聪明,贵,慢", - // available: false, - // }, { - name: "gpt-4-0125-preview", + name: "gpt-4-turbo-2024-04-09", describe: "GPT-4,最新版,推荐", available: true, provider: { @@ -252,6 +238,21 @@ export const DEFAULT_MODELS = [ providerType: "openai", }, }, + // { + // name: "gpt-4", + // describe: "GPT-4,聪明,贵,慢", + // available: false, + // }, + // { + // name: "gpt-4-0125-preview", + // describe: "GPT-4,最新版,推荐", + // available: true, + // provider: { + // id: "openai", + // providerName: "OpenAI", + // providerType: "openai", + // }, + // }, { name: "gpt-4-1106-preview", describe: "GPT-4,旧版,备用", @@ -262,16 +263,6 @@ export const DEFAULT_MODELS = [ providerType: "openai", }, }, - { - name: "gpt-4-turbo-2024-04-09", - describe: "GPT-4,新版,测试", - available: true, - provider: { - id: "openai", - providerName: "OpenAI", - providerType: "openai", - }, - }, { name: "claude-3-opus-20240229", describe: "claude第三代模型最强版", @@ -345,8 +336,8 @@ export const DEFAULT_MODELS = [ ] as const; export const AZURE_MODELS: string[] = [ - "gpt-35-turbo-0125", - "gpt-4-0125-preview", + // "gpt-35-turbo-0125", + "gpt-4-turbo-2024-04-09", ]; // export const AZURE_PATH = AZURE_MODELS.map((m) => { m: `openai/deployments/${m}/chat/completions`}); // export const AZURE_PATH = AZURE_MODELS.map((m) => ({ m: `openai/deployments/${m}/chat/completions`} )); diff --git a/app/store/config.ts b/app/store/config.ts index 56ca4c072..f24a985ac 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -137,7 +137,7 @@ export const useAppConfig = createPersistStore( }), { name: StoreKey.Config, - version: 3.8994, + version: 3.8995, migrate(persistedState, version) { const state = persistedState as ChatConfig; @@ -168,7 +168,7 @@ export const useAppConfig = createPersistStore( if (version < 3.8) { state.lastUpdate = Date.now(); } - if (version < 3.8994) { + if (version < 3.8995) { state.lastUpdate = Date.now(); return { ...DEFAULT_CONFIG }; } diff --git a/start.sh b/start.sh index bf178c668..7738270aa 100755 --- a/start.sh +++ b/start.sh @@ -1,13 +1,13 @@ #!/bin/bash set -e # 加速 -#yarn config set registry 'https://registry.npmmirror.com/' -#yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp" -#yarn config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips" +yarn config set registry 'https://registry.npmmirror.com/' +yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp" +yarn config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips" # 官方 -yarn config delete registry -yarn config delete sharp_binary_host -yarn config delete sharp_libvips_binary_host +#yarn config delete registry +#yarn config delete sharp_binary_host +#yarn config delete sharp_libvips_binary_host yarn cache clean yarn install @@ -34,3 +34,5 @@ rsync -az --delete ./.next/server/ ${OUT_DIR}/.next/server rsync -az --delete "./node_modules/tiktoken/" ${OUT_DIR}/node_modules/tiktoken docker network ls | grep -qw chatgpt-ns || docker network create chatgpt-ns +docker build -t registry.cn-hangzhou.aliyuncs.com/si-private/chatgpt-next-web:temp -f Dockerfile.linux-build . +docker tag registry.cn-hangzhou.aliyuncs.com/si-private/chatgpt-next-web:temp registry.cn-hangzhou.aliyuncs.com/si-private/chatgpt-next-web:latest