FROM python:3.10-slim WORKDIR /app # Install system packages RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ ffmpeg \ libsndfile1 \ cmake \ libopenblas-dev \ && rm -rf /var/lib/apt/lists/* ENV HOME=/tmp ENV HF_HOME=/tmp/huggingface ENV PYTHONUNBUFFERED=1 ENV PYTHONPATH="/app/src" ENV PORT=7860 # Create writable directories used at runtime RUN mkdir -p /tmp/huggingface /app/static /app/static/audio /app/tmp && \ chmod -R 777 /tmp /app/static /app/tmp # Copy files COPY requirements.txt ./ COPY src/ ./src/ COPY static/ ./static/ COPY frontend/ ./frontend/ # Install Python dependencies RUN pip3 install --no-cache-dir -r requirements.txt EXPOSE 7860 HEALTHCHECK CMD curl --fail http://localhost:7860/health || exit 1 ENTRYPOINT ["python", "-m", "uvicorn", "src.server.main:app"] CMD ["--host", "0.0.0.0", "--port", "7860"]