Spaces:
Running
Running
File size: 1,389 Bytes
2b770e0 | 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 | # ================================================================================
# CODE VED - PRODUCTION DOCKERFILE
# Engineered by Divy Patel | Modular Architecture
# ================================================================================
# 1. Use a lightweight but compatible Python base image
FROM python:3.10-slim
# 2. Set the working directory inside the container
WORKDIR /app
# 3. Install system-level dependencies
# - git: Required to clone 'renderlib' from GitHub in requirements.txt
# - ffmpeg & libsndfile1: Required by 'supertonic' and 'pydub' for audio processing
# - build-essential: Sometimes needed for compiling C-extensions in Python packages
RUN apt-get update && apt-get install -y \
git \
ffmpeg \
libsndfile1 \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# 4. Copy only requirements.txt first to leverage Docker cache
# (If requirements don't change, Docker won't reinstall packages every time)
COPY requirements.txt .
# 5. Install Python dependencies
# --no-cache-dir keeps the image size small
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# 6. Copy the rest of the application code (HTML, CSS, JS, Python files)
COPY . .
# 7. Hugging Face Spaces requires the app to listen on port 7860
EXPOSE 7860
# 8. Command to run the Flask application
CMD ["python", "app.py"]
|