Files
banban/talkingq-url/Dockerfile
2026-03-24 15:04:36 +08:00

29 lines
1.1 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# FROM python:3.12-slim
FROM python:3.11-bookworm
RUN rm -f /etc/apt/sources.list.d/* \
&& echo "deb https://mirrors.aliyun.com/debian bookworm main" > /etc/apt/sources.list \
&& echo "deb https://mirrors.aliyun.com/debian bookworm-updates main" >> /etc/apt/sources.list \
&& echo "deb https://mirrors.aliyun.com/debian-security bookworm-security main" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y ffmpeg build-essential git default-mysql-client \
&& rm -rf /var/lib/apt/lists/*
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /app
COPY requirements.txt .
RUN pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/ \
--trusted-host mirrors.aliyun.com && \
pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ \
--trusted-host mirrors.aliyun.com \
-r requirements.txt \
&& rm -rf /root/.cache/pip
COPY . .
# 将workers数量从5改为1解决WebSocket连接在多进程间不共享的问题
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080", "--workers", "1"]