Spaces:
Sleeping
Sleeping
File size: 951 Bytes
faaee74 1cc5250 faaee74 1cc5250 faaee74 1cc5250 faaee74 1cc5250 faaee74 1cc5250 faaee74 1cc5250 faaee74 |
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 28 29 30 31 32 33 34 35 36 37 |
# Lightweight Python image
FROM python:3.10-slim
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg git build-essential \
&& rm -rf /var/lib/apt/lists/*
# Make writable dirs for caches and NLTK
RUN mkdir -p /data/nltk_data \
/data/huggingface/transformers \
/data/huggingface/datasets \
/data/tmp && chmod -R 777 /data
# Point all caches to /data (writable)
ENV NLTK_DATA=/data/nltk_data
ENV HF_HOME=/data/huggingface
ENV TRANSFORMERS_CACHE=/data/huggingface/transformers
ENV HF_DATASETS_CACHE=/data/huggingface/datasets
ENV TMPDIR=/data/tmp
# Optional: choose Whisper size via env (ignored now if using SpeechRecognition)
ENV WHISPER_MODEL=base
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
COPY README.md .
# Spaces expects port 7860
ENV PORT=7860
# Start FastAPI
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|