File size: 1,170 Bytes
793e953 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | # ================================================================
# VetCopilot 后端 Dockerfile
#
# 构建: docker build -f deploy/Dockerfile.backend -t vetcopilot-backend .
# 运行: docker run -p 8080:8080 --env-file deploy/.env.production vetcopilot-backend
# ================================================================
FROM python:3.12-slim
# 安装系统依赖(FFmpeg 用于音频转码)
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libsndfile1 \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# 安装 Python 依赖
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 可选:安装 FunASR(SenseVoice 引擎)
# RUN pip install --no-cache-dir funasr sentencepiece
# 复制应用代码
COPY . .
# 创建数据目录
RUN mkdir -p /app/data /app/uploads/audio /app/uploads/exports /app/logs /app/backups
# 暴露端口
EXPOSE 8080
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost:8080/api/system/health || exit 1
# 启动
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]
|