Dockerfile 484 B

123456789101112131415161718192021
  1. # 使用Python 3.9作为基础镜像
  2. FROM python:3.10-slim
  3. # 设置工作目录
  4. WORKDIR /app
  5. # 复制依赖文件并安装依赖
  6. COPY requirements.txt .
  7. RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
  8. # 复制应用代码
  9. COPY . .
  10. # 设置环境变量
  11. ENV PYTHONUNBUFFERED=1
  12. # 暴露streamlit默认端口
  13. EXPOSE 8501
  14. # 设置容器启动命令
  15. CMD ["streamlit", "run", "qa_ui.py", "--server.address=0.0.0.0", "--server.port=8501"]