maxjski commited on
Commit
f5d1a8b
·
1 Parent(s): b0c9198

deployment fix

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -2
Dockerfile CHANGED
@@ -8,18 +8,42 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
8
 
9
  WORKDIR /code
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  # ---- Install Python deps --------------------------------------------------
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # No extra system packages required now that Redis and Celery are removed
16
-
17
  # ---- Copy project code ----------------------------------------------------
18
  COPY . .
19
 
20
  # ---- Create startup script ------------------------------------------------
21
  RUN echo '#!/bin/bash\n\
22
  set -e\n\
 
 
 
 
23
  # Launch FastAPI app\n\
24
  exec python main.py\n' > /code/start.sh && chmod +x /code/start.sh
25
 
 
8
 
9
  WORKDIR /code
10
 
11
+ # ---- Install system dependencies for OpenGL/EGL (required for pyrender) ----
12
+ RUN apt-get update && apt-get install -y \
13
+ libgl1-mesa-glx \
14
+ libgl1-mesa-dri \
15
+ libglu1-mesa \
16
+ libegl1-mesa \
17
+ libgbm1 \
18
+ libxext6 \
19
+ libxrender1 \
20
+ libxfixes3 \
21
+ libxi6 \
22
+ libxrandr2 \
23
+ libxss1 \
24
+ libgtk-3-0 \
25
+ libgconf-2-4 \
26
+ xvfb \
27
+ && rm -rf /var/lib/apt/lists/*
28
+
29
+ # Set environment variables for headless OpenGL rendering
30
+ ENV DISPLAY=:99
31
+ ENV PYOPENGL_PLATFORM=egl
32
+
33
  # ---- Install Python deps --------------------------------------------------
34
  COPY requirements.txt .
35
  RUN pip install --no-cache-dir -r requirements.txt
36
 
 
 
37
  # ---- Copy project code ----------------------------------------------------
38
  COPY . .
39
 
40
  # ---- Create startup script ------------------------------------------------
41
  RUN echo '#!/bin/bash\n\
42
  set -e\n\
43
+ # Start virtual framebuffer for headless OpenGL\n\
44
+ Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &\n\
45
+ # Wait a moment for Xvfb to start\n\
46
+ sleep 2\n\
47
  # Launch FastAPI app\n\
48
  exec python main.py\n' > /code/start.sh && chmod +x /code/start.sh
49