FROM registry.cn-hangzhou.aliyuncs.com/stuuudy/python:3.13-slim

RUN rm -rf /etc/apt/sources.list.d/*


RUN echo "deb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free" > /etc/apt/sources.list.d/aliyun.list \
    && echo "deb https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free" >> /etc/apt/sources.list.d/aliyun.list \
    && echo "deb https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free" >> /etc/apt/sources.list.d/aliyun.list \
    && apt-get update

RUN apt-get install -y tzdata \
    && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone \
    && rm -rf /var/lib/apt/lists/*


RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone

RUN pip install uv  -i  https://mirrors.aliyun.com/pypi/simple

RUN mkdir -p /video_decode
WORKDIR /video_decode

COPY . /video_decode

RUN uv venv 
ENV PATH="/video_decode/.venv/bin:$PATH"
RUN uv pip install -r requirements.txt   -i  https://mirrors.aliyun.com/pypi/simple

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]