Skip to content

Commit

Permalink
v4.6.5 (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu authored Dec 18, 2023
1 parent d33c99f commit 703583f
Show file tree
Hide file tree
Showing 130 changed files with 3,371 additions and 2,532 deletions.
64 changes: 44 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,57 +1,81 @@
# Install dependencies only when needed
FROM node:18.15-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat && npm install -g pnpm
# --------- install dependence -----------
FROM node:18.17-alpine AS mainDeps
WORKDIR /app

ARG name
ARG proxy

RUN [ -z "$proxy" ] || sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache libc6-compat && npm install -g [email protected]
# if proxy exists, set proxy
RUN [ -z "$proxy" ] || pnpm config set registry https://registry.npm.taobao.org

# copy packages and one project
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
COPY ./packages ./packages
COPY ./projects/$name/package.json ./projects/$name/package.json

RUN [ -f pnpm-lock.yaml ] || (echo "Lockfile not found." && exit 1)

RUN pnpm install
RUN pnpm i

# --------- install dependence -----------
FROM node:18.17-alpine AS workerDeps
WORKDIR /app

ARG proxy

# Rebuild the source code only when needed
FROM node:18.15-alpine AS builder
RUN [ -z "$proxy" ] || sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache libc6-compat && npm install -g [email protected]
# if proxy exists, set proxy
RUN [ -z "$proxy" ] || pnpm config set registry https://registry.npm.taobao.org

COPY ./worker /app/worker
RUN cd /app/worker && pnpm i --production --ignore-workspace

# --------- builder -----------
FROM node:18.17-alpine AS builder
WORKDIR /app

ARG name
ARG proxy

# copy common node_modules and one project node_modules
COPY package.json pnpm-workspace.yaml ./
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/packages ./packages
COPY --from=mainDeps /app/node_modules ./node_modules
COPY --from=mainDeps /app/packages ./packages
COPY ./projects/$name ./projects/$name
COPY --from=deps /app/projects/$name/node_modules ./projects/$name/node_modules
COPY --from=mainDeps /app/projects/$name/node_modules ./projects/$name/node_modules

# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1
RUN npm install -g pnpm
RUN pnpm --filter=$name run build
RUN [ -z "$proxy" ] || sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories

RUN apk add --no-cache libc6-compat && npm install -g pnpm@8.6.0
RUN pnpm --filter=$name build

FROM node:18.15-alpine AS runner
# --------- runner -----------
FROM node:18.17-alpine AS runner
WORKDIR /app

ARG name
ARG proxy

# create user and use it
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

RUN [ -z "$proxy" ] || sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache curl ca-certificates \
&& update-ca-certificates

# copy running files
COPY --from=builder /app/projects/$name/public ./projects/$name/public
COPY --from=builder /app/projects/$name/next.config.js ./projects/$name/next.config.js
COPY --from=builder --chown=nextjs:nodejs /app/projects/$name/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/projects/$name/.next/static ./projects/$name/.next/static
COPY --from=builder /app/projects/$name/public /app/projects/$name/public
COPY --from=builder /app/projects/$name/next.config.js /app/projects/$name/next.config.js
COPY --from=builder --chown=nextjs:nodejs /app/projects/$name/.next/standalone /app/
COPY --from=builder --chown=nextjs:nodejs /app/projects/$name/.next/static /app/projects/$name/.next/static
# copy package.json to version file
COPY --from=builder /app/projects/$name/package.json ./package.json
# copy woker
COPY --from=workerDeps /app/worker /app/worker

ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
Expand Down
Binary file added docSite/assets/imgs/customfeedback1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/customfeedback2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/customfeedback3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/customfeedback4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docSite/assets/imgs/history.png
Binary file not shown.
Binary file modified docSite/assets/imgs/http1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions docSite/content/docs/workflow/modules/custom_feedback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: "自定义反馈"
description: "自定义反馈模块介绍"
icon: "feedback"
draft: false
toc: true
weight: 354
---

该模块为临时模块,后续会针对该模块进行更全面的设计。

## 特点

- 可重复添加
- 无外部输入
- 自动执行


| | |
| --------------------- | --------------------- |
| ![](/imgs/customfeedback1.png) | ![](/imgs/customfeedback2.png) |
| ![](/imgs/customfeedback3.png) | ![](/imgs/customfeedback4.png) |


## 介绍

自定义反馈模块,可以为你的对话增加一个反馈标记,从而方便在后台更好的分析对话的数据。

在调试模式下,不会记录反馈内容,而是直接提示: `自动反馈测试: 反馈内容`

在对话模式(对话、分享窗口、带 chatId 的 API 调用)时,会将反馈内容记录到对话日志中。(会延迟60s记录)

## 作用

自定义反馈模块的功能类似于程序开发的`埋点`,便于你观测的对话中的数据。
19 changes: 0 additions & 19 deletions docSite/content/docs/workflow/modules/history.md

This file was deleted.

Loading

0 comments on commit 703583f

Please sign in to comment.