File size: 782 Bytes
94cf126 587a9f7 e387351 587a9f7 ed06573 587a9f7 e387351 ed06573 587a9f7 94cf126 a2c0410 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
FROM python:3.10-slim
# Install ffmpeg for pydub and build tools for compiling C++ extensions
RUN apt-get update && apt-get install -y \
ffmpeg \
build-essential \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Set environment variables for writable directories
ENV MPLCONFIGDIR=/app/.config/matplotlib
ENV HF_HOME=/app/.cache/huggingface
ENV LHOTSE_TOOLS=/app/.lhotse/tools
ENV NUMBA_CACHE_DIR=/app/.cache/numba
# Create writable directories and set permissions
RUN mkdir -p $MPLCONFIGDIR $HF_HOME $LHOTSE_TOOLS $NUMBA_CACHE_DIR && \
chmod -R 777 $MPLCONFIGDIR $HF_HOME $LHOTSE_TOOLS $NUMBA_CACHE_DIR
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
ENTRYPOINT ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|