# 使用打包的sorawm基础镜像，基于官方的python3.12-slim制作
FROM registry.piaoquantv.com/base/sorawm:v1

# 设置工作目录
WORKDIR /app

# 安装依赖：FFmpeg + 基本构建工具
RUN rm -rf /etc/apt/sources.list.d/* && \
    echo "deb http://mirrors.aliyun.com/debian/ bookworm main non-free contrib" > /etc/apt/sources.list && \
    echo "deb http://mirrors.aliyun.com/debian/ bookworm-updates main non-free contrib" >> /etc/apt/sources.list && \
    echo "deb http://mirrors.aliyun.com/debian/ bookworm-backports main non-free contrib" >> /etc/apt/sources.list && \
    echo "deb http://mirrors.aliyun.com/debian-security bookworm-security main non-free contrib" >> /etc/apt/sources.list && \
    apt-get update && \
    apt-get install -y --no-install-recommends ffmpeg curl && \
    rm -rf /var/lib/apt/lists/*

ENV PATH="/root/.local/bin:${PATH}"

# 复制项目文件
COPY . /app

# 暴露服务端口（FastAPI 默认 5344）
EXPOSE 5344

# 容器启动命令
CMD ["/app/sorawm_start.sh"]
