|
FROM python:3.9-slim |
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN mkdir -p /tmp/transformers_cache /tmp/huggingface /tmp/numba_cache && \ |
|
chmod 777 /tmp/transformers_cache /tmp/huggingface /tmp/numba_cache |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
ffmpeg \ |
|
libsndfile1 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY requirements.txt . |
|
COPY app.py . |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
ENV TRANSFORMERS_CACHE=/tmp/transformers_cache |
|
ENV HF_HOME=/tmp/huggingface |
|
ENV NUMBA_CACHE_DIR=/tmp/numba_cache |
|
ENV NUMBA_DISABLE_JIT=1 |
|
|
|
EXPOSE 7860 |
|
|
|
CMD ["python", "app.py"] |