tommy24 commited on
Commit
29d4fa3
·
verified ·
1 Parent(s): 74e33e5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -5
Dockerfile CHANGED
@@ -1,12 +1,35 @@
 
1
  FROM python:3.9
2
 
3
- # Install dependencies
4
- COPY requirements.txt .
5
- RUN pip install -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  # Copy project files
8
  COPY . /app
9
- WORKDIR /app
10
 
11
- # Run FastAPI
 
 
 
 
 
 
 
 
12
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use an official Python base image
2
  FROM python:3.9
3
 
4
+ # Set environment variables
5
+ ENV PYTHONUNBUFFERED=1 \
6
+ PYTHONDONTWRITEBYTECODE=1
7
+
8
+ # Install required system libraries for Manim and dependencies
9
+ RUN apt-get update && apt-get install -y \
10
+ ffmpeg \
11
+ libcairo2 \
12
+ libpango1.0-0 \
13
+ libx11-6 \
14
+ libgl1-mesa-glx \
15
+ xvfb \
16
+ pkg-config \
17
+ pangocairo \
18
+ && apt-get clean
19
+
20
+ # Set the working directory
21
+ WORKDIR /app
22
 
23
  # Copy project files
24
  COPY . /app
 
25
 
26
+ # Install Python dependencies
27
+ RUN pip install --no-cache-dir --upgrade pip
28
+ COPY requirements.txt .
29
+ RUN pip install --no-cache-dir -r requirements.txt
30
+
31
+ # Expose the port
32
+ EXPOSE 7860
33
+
34
+ # Run the FastAPI server
35
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]