FROM python:3.11-slim WORKDIR /opt/maxkb-app ENV DEBIAN_FRONTEND=noninteractive \ PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ HF_HOME=/opt/maxkb-app/model/base \ TMPDIR=/opt/maxkb-app/tmp \ PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple \ PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn RUN rm -f /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources && \ echo 'deb http://mirrors.tuna.tsinghua.edu.cn/debian/ trixie main non-free contrib non-free-firmware' > /etc/apt/sources.list && \ echo 'deb http://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-updates main non-free contrib non-free-firmware' >> /etc/apt/sources.list && \ echo 'deb http://mirrors.tuna.tsinghua.edu.cn/debian-security/ trixie-security main non-free contrib non-free-firmware' >> /etc/apt/sources.list && \ apt-get update && apt-get install -y --no-install-recommends \ build-essential \ gcc \ python3-dev \ libpq-dev \ curl \ git \ wget \ ffmpeg \ && rm -rf /var/lib/apt/lists/* RUN pip install --no-cache-dir --upgrade pip setuptools wheel COPY pyproject.toml README.md ./ COPY apps/ ./apps/ COPY main.py ./ RUN pip install --no-cache-dir --break-system-packages torch==2.8.0 --index-url https://pypi.tuna.tsinghua.edu.cn/simple RUN pip install . RUN mkdir -p /opt/maxkb-app/model/base /opt/maxkb-app/tmp /opt/maxkb-app/logs COPY start.sh /opt/maxkb-app/start.sh RUN chmod +x /opt/maxkb-app/start.sh EXPOSE 8080 CMD ["/opt/maxkb-app/start.sh"]