fix(ports): docker 默认对外8502并修复空DB连接串回退

This commit is contained in:
Tony Zhang
2025-12-17 10:35:14 +08:00
parent 81a4faabf5
commit e365a94dd1
5 changed files with 333 additions and 4 deletions

37
Dockerfile Normal file
View File

@@ -0,0 +1,37 @@
# Video Flow - Python 后端 Dockerfile
FROM python:3.11-slim
# 安装系统依赖
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libsm6 \
libxext6 \
libgl1 \
fonts-noto-cjk \
fonts-wqy-zenhei \
curl \
&& rm -rf /var/lib/apt/lists/*
# 设置工作目录
WORKDIR /app
# 复制依赖文件
COPY requirements.txt .
# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt
# 复制应用代码
COPY . .
# 创建必要的目录
RUN mkdir -p /app/output /app/temp /app/assets
# 暴露端口
# - 8000: FastAPI
# - 8503: Streamlitdocker-compose.yml 中运行在 85038502 是历史 runtime 标识)
EXPOSE 8000 8503
# 默认命令
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]