| FROM python:3.10-slim |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| ffmpeg \ |
| git \ |
| git-lfs \ |
| gcc \ |
| g++ \ |
| make \ |
| build-essential \ |
| curl \ |
| ca-certificates \ |
| libopenblas-dev \ |
| && rm -rf /var/lib/apt/lists/* && update-ca-certificates |
|
|
| |
| RUN git lfs install --skip-repo |
|
|
| WORKDIR /app |
|
|
| |
| COPY . . |
|
|
| |
| RUN git lfs pull 2>/dev/null || echo "Git LFS files skipped (may be pre-downloaded)" |
|
|
| |
| RUN pip install --no-cache-dir 'numpy<2.0.0' 'scipy<1.14.0' Cython |
| RUN pip install --no-cache-dir 'fakeredis[lua]' mir_eval |
| RUN pip install --no-cache-dir -r backend/requirements.txt |
| RUN pip install --no-cache-dir --force-reinstall 'numpy<2.0.0' |
|
|
| |
| RUN mkdir -p /app/storage && chmod 777 /app/storage |
|
|
| |
| COPY start-backend.sh /app/start-backend.sh |
| RUN chmod +x /app/start-backend.sh |
|
|
| |
| ENV API_PORT=7860 |
| ENV API_HOST=0.0.0.0 |
| ENV PYTHONPATH=/app/backend |
| ENV PYTHONUNBUFFERED=1 |
|
|
| |
| ENV RES_OPTIONS="single-request-reopen" |
| ENV LANG=C.UTF-8 |
| ENV LC_ALL=C.UTF-8 |
|
|
| |
| ENV USE_FAKE_REDIS=true |
|
|
| EXPOSE 7860 |
|
|
| |
| WORKDIR /app/backend |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
| CMD curl -f http://localhost:7860/health || exit 1 |
|
|
| |
| CMD ["/app/start-backend.sh"] |
|
|