mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-09-19 10:28:49 +08:00
- Updated the `KnowledgeBase` struct to rename `cos_config` to `storage_config` for consistency across the application. - Implemented a custom `UnmarshalJSON` method to maintain backward compatibility with legacy responses that still use `cos_config`. - Modified various frontend components to reflect the new `storage_config` naming, ensuring seamless integration with the updated backend structure. - Enhanced Dockerfiles and service configurations to support the new storage engine setup. This update improves the clarity of storage configurations and ensures compatibility with existing data structures.
43 lines
882 B
Docker
43 lines
882 B
Docker
# 构建阶段
|
||
FROM node:24-alpine AS build-stage
|
||
|
||
WORKDIR /app
|
||
|
||
# 设置环境变量,忽略类型检查错误
|
||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
||
ENV VITE_IS_DOCKER=true
|
||
|
||
# 复制依赖文件
|
||
COPY package*.json ./
|
||
COPY packages/xlsx-0.20.2.tgz ./packages/xlsx-0.20.2.tgz
|
||
|
||
# 安装依赖
|
||
RUN corepack enable
|
||
RUN pnpm install
|
||
|
||
# 复制项目文件
|
||
COPY . .
|
||
|
||
# 构建应用
|
||
RUN pnpm run build
|
||
|
||
# 生产阶段
|
||
FROM nginx:stable-alpine AS production-stage
|
||
|
||
# 复制构建产物到nginx服务目录
|
||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||
|
||
# 复制nginx配置模板文件
|
||
COPY nginx.conf /etc/nginx/templates/default.conf.template
|
||
|
||
# 复制启动脚本
|
||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||
RUN chmod +x /docker-entrypoint.sh
|
||
|
||
# 设置默认环境变量(MB)
|
||
ENV MAX_FILE_SIZE_MB=50
|
||
|
||
# 暴露端口
|
||
EXPOSE 80
|
||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] |