|
|
|
|
|
FROM python:3.11-slim |
|
|
|
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
ffmpeg \ |
|
|
git \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
COPY requirements.txt . |
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir "numpy<2.0.0" && \ |
|
|
pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
|
ENV WHISPER_MODEL=tiny |
|
|
ENV MODEL_PRELOAD=true |
|
|
ENV DEBUG=false |
|
|
ENV PYTHONUNBUFFERED=1 |
|
|
|
|
|
|
|
|
COPY . . |
|
|
|
|
|
|
|
|
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app |
|
|
USER appuser |
|
|
|
|
|
|
|
|
EXPOSE 8000 |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ |
|
|
CMD python -c "import requests; requests.get('http://localhost:8000/health')" |
|
|
|
|
|
|
|
|
CMD ["python", "start_robust.py"] |
|
|
|