FROM python:3.11-slim ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ TMP_DIR=/tmp/uploads \ PORT=7860 \ HF_HOME=/tmp/huggingface \ TRANSFORMERS_CACHE=/tmp/huggingface RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ ffmpeg libsndfile1 git build-essential wget curl redis-server && \ rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements.txt . RUN pip install --upgrade pip && \ pip install --no-cache-dir -r requirements.txt rq COPY . . COPY start.sh /start.sh RUN chmod +x /start.sh && mkdir -p ${TMP_DIR} EXPOSE ${PORT} HEALTHCHECK --interval=30s --timeout=3s --start-period=15s \ CMD curl -f http://localhost:${PORT}/health || exit 1 CMD ["/start.sh"]