|
|
FROM python:3.9-slim |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
ffmpeg \ |
|
|
git \ |
|
|
wget \ |
|
|
curl \ |
|
|
libsndfile1 \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
RUN mkdir -p /cache && \ |
|
|
chown -R 1000:1000 /cache && \ |
|
|
chmod -R 755 /cache |
|
|
|
|
|
|
|
|
ENV HF_HOME=/cache |
|
|
ENV HUGGINGFACE_HUB_CACHE=/cache |
|
|
ENV TMPDIR=/tmp |
|
|
|
|
|
|
|
|
COPY requirements.txt . |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
|
COPY . . |
|
|
|
|
|
|
|
|
RUN mkdir -p /tmp/whisper_temp && \ |
|
|
chmod 777 /tmp/whisper_temp |
|
|
|
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=300s --retries=3 \ |
|
|
CMD curl -f http://localhost:7860/health || exit 1 |
|
|
|
|
|
|
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "600", "--workers", "1", "--threads", "4", "--preload", "app:app"] |