ClareVoiceV1 / Dockerfile
claudqunwang's picture
Fix Weaviate client and HF embedding setup
182c636
# ClareVoice:React 产品版 UI + Weaviate 后端
# 需在目录内包含 web/ 前端源码(已从项目根拷入)。见 使用说明-React.md
# 1) 构建前端
FROM node:20-slim AS web_builder
WORKDIR /web
COPY web/package*.json ./
RUN npm install
COPY web/ ./
RUN npm run build
# 2) 后端
FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && \
# libxcb* 用于前端构建依赖,libgl1 解决 unstructured[pdf] 对 libGL.so.1 的依赖
apt-get install -y --no-install-recommends libxcb1 libxcb-xinerama0 libgl1 && \
rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir "huggingface_hub>=1.3.0,<2.0"
COPY . .
COPY --from=web_builder /web/build ./web/build
USER user
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
EXPOSE 7860
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]