Spaces:
Build error
Build error
Update Dockerfile
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192# Use a standard Python 3.11 slim image as the baseFROM python:3.11-slim# Set the working directory inside the containerWORKDIR /code# Set environment variable to prevent interactive prompts during package installationENV DEBIAN_FRONTEND=noninteractive# Install system-level dependencies:# Core build tools# - build-essential: C compiler (gcc) and build tools for Python packages# - gcc: GNU Compiler Collection# - g++: C++ compiler# - make: Build automation tool# - pkg-config: Package configuration tool# Media and graphics# - ffmpeg: Required by manim for video processing# - libcairo2-dev: Cairo graphics library development files# - libgirepository1.0-dev: GObject introspection development files# - libpango1.0-dev: Pango text rendering library# - libgdk-pixbuf2.0-dev: Image loading library# - libatk1.0-dev: Accessibility toolkit# - libgtk-3-dev: GTK+ 3 development files# LaTeX and fonts# - texlive-latex-base: Basic LaTeX for math rendering# - texlive-latex-extra: Additional LaTeX packages# - texlive-fonts-recommended: Additional fonts# - texlive-fonts-extra: Extra fonts for better rendering# - cm-super: Computer Modern fonts# - dvipng: DVI to PNG converter for LaTeX# Development tools# - python3-dev: Python development headers# - python3-pip: Python package installer# - git: Version control (good practice)# - curl: HTTP client# - wget: File downloader# - unzip: Archive extractionRUN apt-get update && apt-get install -y --no-install-recommends \build-essential \gcc \g++ \make \pkg-config \ffmpeg \libcairo2-dev \libgirepository1.0-dev \libpango1.0-dev \libgdk-pixbuf2.0-dev \libatk1.0-dev \libgtk-3-dev \texlive-latex-base \texlive-latex-extra \texlive-fonts-recommended \texlive-fonts-extra \cm-super \dvipng \python3-dev \python3-pip \git \curl \wget \unzip \&& apt-get clean \&& rm -rf /var/lib/apt/lists/*# Copy the requirements file into the containerCOPY requirements.txt .# Install Python packages specified in requirements.txtRUN pip install --no-cache-dir --upgrade -r requirements.txt# Set the user to avoid permission issues (recommended for Hugging Face)RUN useradd -m -u 1000 user# Create media directories with proper permissions before switching userRUN mkdir -p /code/media /code/tmp_media && \chown -R user:user /code# Switch to the userUSER userENV HOME=/home/user \PATH=/home/user/.local/bin:$PATH# Copy application files with proper ownershipCOPY --chown=user . .# Expose the port Gradio runs on (7860)EXPOSE 7860# The command to run when the container starts: launch the Gradio appCMD ["gradio", "app.py"]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556# Set environment variable to prevent interactive prompts during package installationENV DEBIAN_FRONTEND=noninteractive# Install all potential system-level dependencies for a full Manim installation# This "kitchen sink" approach helps prevent future build errors.RUN apt-get update && apt-get install -y --no-install-recommends \# --- Core Build Tools ---build-essential \pkg-config \# --- Manim Dependencies ---ffmpeg \texlive-full \libcairo2-dev \libpango1.0-dev \# --- Extra Dependencies for Optional Features (e.g., manim-voiceover) ---libgl1-mesa-glx \libglib2.0-0 \libsm6 \libxext6 \libxrender1 \espeak \sox \&& apt-get clean \&& rm -rf /var/lib/apt/lists/*# Install Python packages specified in requirements.txtRUN pip install --no-cache-dir --upgrade -r requirements.txt# Copy all the application files (app.py, proof.py, etc.) into the containerCOPY . .# Expose the port Gradio runs on (7860)EXPOSE 7860# The command to run when the container starts: launch the Gradio appCMD ["gradio", "app.py"]
Dockerfile+34-70