feat: add production Docker deployment

This commit is contained in:
2026-07-20 13:29:24 +08:00
parent 75abc7bfe1
commit 70e97ae8b9
5 changed files with 145 additions and 8 deletions

View File

@@ -1,18 +1,22 @@
FROM python:3.10-slim
ARG DEBIAN_MIRROR=http://deb.debian.org
ARG PYPI_INDEX_URL=https://pypi.org/simple
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
RUN apt-get update \
RUN sed -i "s|http://deb.debian.org|${DEBIAN_MIRROR}|g" /etc/apt/sources.list.d/debian.sources \
&& apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt ./
RUN pip install --upgrade pip \
&& pip install torch==2.8.0 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cpu \
&& pip install -r requirements.txt
RUN pip install --index-url "${PYPI_INDEX_URL}" --upgrade pip
RUN pip install torch==2.8.0 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cpu
RUN pip install --index-url "${PYPI_INDEX_URL}" -r requirements.txt
COPY app.py ./