FROM python:3.11-slim WORKDIR /app ENV PYTHONPATH=/app # 设置 pip 国内镜像源 RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # 复制前端依赖并安装 COPY frontend/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 复制前端代码 COPY frontend/src/ ./src/ # 暴露端口 EXPOSE 8501 # 启动命令 CMD ["streamlit", "run", "src/frontend_main.py", "--server.port", "8501", "--server.address", "0.0.0.0", "--server.baseUrlPath", "/ai"]