| FROM python:3.10-slim |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| ffmpeg \ |
| libsndfile1 \ |
| wget \ |
| git \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| WORKDIR /app |
|
|
| |
| COPY requirements.txt . |
|
|
| |
| RUN pip install --no-cache-dir torch==2.5.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cpu |
|
|
| |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| RUN python -m spacy download en_core_web_sm |
|
|
| |
| COPY app.py . |
|
|
| |
| RUN mkdir -p /app/models |
|
|
| |
| ENV PYTHONUNBUFFERED=1 |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \ |
| CMD curl -f http://localhost:7860/health || exit 1 |
|
|
| |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |
|
|