Spaces:
Running
Running
File size: 1,858 Bytes
04e0ce2 7786e96 e65a8eb 04e0ce2 9e4a797 890829d 04e0ce2 e65a8eb 04e0ce2 e65a8eb 04e0ce2 b039445 04e0ce2 b039445 04e0ce2 7b8f950 04e0ce2 cf8ed1a 7b8f950 04e0ce2 c9d7ff6 04e0ce2 c9d7ff6 04e0ce2 e65a8eb 04e0ce2 c9d7ff6 3b64741 35e2a0f 04e0ce2 b5f1353 04e0ce2 35e2a0f 04e0ce2 9e4a797 35e2a0f 04e0ce2 e65a8eb 35e2a0f 04e0ce2 9e4a797 04e0ce2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# Use an official Python runtime as a parent image (Debian 12 Bookworm)
FROM python:3.9-slim
# Disable Python bytecode and buffer stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
# Ensure NumPy <2 so all C extensions load correctly
NUMPY_EXPLICIT_VERSION=1.23.5
# Working directory
WORKDIR /app
# Install build dependencies, audio/video libs, and LLVM 14 for llvmlite
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
libedit-dev \
libffi-dev \
python3-dev \
libgl1-mesa-glx libsm6 libxrender1 libglib2.0-0 \
ffmpeg \
libsndfile1 libsndfile1-dev \
clang-14 llvm-14-dev llvm-14-runtime \
&& rm -rf /var/lib/apt/lists/*
# Point llvmlite at the correct llvm-config
ENV LLVM_CONFIG=/usr/bin/llvm-config-14
# Remove any preinstalled NumPy, then install a NumPy 1.x release
RUN pip uninstall -y numpy || true && \
pip install --no-cache-dir numpy==${NUMPY_EXPLICIT_VERSION}
# Install the trio that need to compile against NumPy 1.x
RUN pip install --no-cache-dir \
llvmlite==0.38.0 \
numba==0.55.2 \
resampy==0.3.1 \
librosa==0.9.2
# Copy your application requirements (must NOT re‑pin NumPy)
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . /app/
# Create and permissively chmod required directories
RUN mkdir -p cache uploads results checkpoints temp && \
chmod -R 777 cache uploads results checkpoints temp
# Ensure the entire app directory is writable
RUN chmod -R 777 /app
# Expose the inference port
EXPOSE 7860
# Environment variables for Flask
ENV FLASK_APP=app.py \
FLASK_ENV=production
# Launch with Gunicorn (defaults: 1 worker, sync, 30s timeout)
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
|