fix(ports): docker 默认对外8502并修复空DB连接串回退
This commit is contained in:
37
Dockerfile
Normal file
37
Dockerfile
Normal 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: Streamlit(docker-compose.yml 中运行在 8503;8502 是历史 runtime 标识)
|
||||
EXPOSE 8000 8503
|
||||
|
||||
# 默认命令
|
||||
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
|
||||
Reference in New Issue
Block a user