parthraninga commited on
Commit
eb5564e
·
verified ·
1 Parent(s): f23ec20

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -70
Dockerfile CHANGED
@@ -1,92 +1,56 @@
1
- # Use a standard Python 3.11 slim image as the base
2
- FROM python:3.11-slim
3
-
4
- # Set the working directory inside the container
5
- WORKDIR /code
6
-
7
  # Set environment variable to prevent interactive prompts during package installation
8
  ENV DEBIAN_FRONTEND=noninteractive
9
 
10
- # Install system-level dependencies:
11
- # Core build tools
12
- # - build-essential: C compiler (gcc) and build tools for Python packages
13
- # - gcc: GNU Compiler Collection
14
- # - g++: C++ compiler
15
- # - make: Build automation tool
16
- # - pkg-config: Package configuration tool
17
- # Media and graphics
18
- # - ffmpeg: Required by manim for video processing
19
- # - libcairo2-dev: Cairo graphics library development files
20
- # - libgirepository1.0-dev: GObject introspection development files
21
- # - libpango1.0-dev: Pango text rendering library
22
- # - libgdk-pixbuf2.0-dev: Image loading library
23
- # - libatk1.0-dev: Accessibility toolkit
24
- # - libgtk-3-dev: GTK+ 3 development files
25
- # LaTeX and fonts
26
- # - texlive-latex-base: Basic LaTeX for math rendering
27
- # - texlive-latex-extra: Additional LaTeX packages
28
- # - texlive-fonts-recommended: Additional fonts
29
- # - texlive-fonts-extra: Extra fonts for better rendering
30
- # - cm-super: Computer Modern fonts
31
- # - dvipng: DVI to PNG converter for LaTeX
32
- # Development tools
33
- # - python3-dev: Python development headers
34
- # - python3-pip: Python package installer
35
- # - git: Version control (good practice)
36
- # - curl: HTTP client
37
- # - wget: File downloader
38
- # - unzip: Archive extraction
39
  RUN apt-get update && apt-get install -y --no-install-recommends \
 
40
  build-essential \
41
- gcc \
42
- g++ \
43
- make \
44
  pkg-config \
 
45
  ffmpeg \
 
46
  libcairo2-dev \
47
- libgirepository1.0-dev \
48
  libpango1.0-dev \
49
- libgdk-pixbuf2.0-dev \
50
- libatk1.0-dev \
51
- libgtk-3-dev \
52
- texlive-latex-base \
53
- texlive-latex-extra \
54
- texlive-fonts-recommended \
55
- texlive-fonts-extra \
56
- cm-super \
57
- dvipng \
58
- python3-dev \
59
- python3-pip \
60
- git \
61
- curl \
62
- wget \
63
- unzip \
64
  && apt-get clean \
65
  && rm -rf /var/lib/apt/lists/*
66
 
67
- # Copy the requirements file into the container
68
- COPY requirements.txt .
69
-
70
  # Install Python packages specified in requirements.txt
71
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
72
 
73
- # Set the user to avoid permission issues (recommended for Hugging Face)
74
- RUN useradd -m -u 1000 user
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
- # Create media directories with proper permissions before switching user
77
- RUN mkdir -p /code/media /code/tmp_media && \
78
- chown -R user:user /code
79
 
80
- # Switch to the user
81
- USER user
82
- ENV HOME=/home/user \
83
- PATH=/home/user/.local/bin:$PATH
84
 
85
- # Copy application files with proper ownership
86
- COPY --chown=user . .
87
 
88
- # Expose the port Gradio runs on (7860)
89
- EXPOSE 7860
90
 
91
  # The command to run when the container starts: launch the Gradio app
92
  CMD ["gradio", "app.py"]
 
 
 
 
 
 
 
1
  # Set environment variable to prevent interactive prompts during package installation
2
  ENV DEBIAN_FRONTEND=noninteractive
3
 
4
+ # Install all potential system-level dependencies for a full Manim installation
5
+ # This "kitchen sink" approach helps prevent future build errors.
6
+
7
+
8
+
9
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ # --- Core Build Tools ---
12
  build-essential \
 
 
 
13
  pkg-config \
14
+ # --- Manim Dependencies ---
15
  ffmpeg \
16
+ texlive-full \
17
  libcairo2-dev \
 
18
  libpango1.0-dev \
19
+ # --- Extra Dependencies for Optional Features (e.g., manim-voiceover) ---
20
+ libgl1-mesa-glx \
21
+ libglib2.0-0 \
22
+ libsm6 \
23
+ libxext6 \
24
+ libxrender1 \
25
+ espeak \
26
+ sox \
 
 
 
 
 
 
 
27
  && apt-get clean \
28
  && rm -rf /var/lib/apt/lists/*
29
 
 
 
 
30
  # Install Python packages specified in requirements.txt
31
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
32
 
33
+ # Copy all the application files (app.py, proof.py, etc.) into the container
34
+ COPY . .
35
+
36
+ # Expose the port Gradio runs on (7860)
37
+ EXPOSE 7860
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
 
 
 
 
51
 
 
 
 
 
52
 
 
 
53
 
 
 
54
 
55
  # The command to run when the container starts: launch the Gradio app
56
  CMD ["gradio", "app.py"]