dev2004v commited on
Commit
d60bd2a
·
verified ·
1 Parent(s): e50db93

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -3
Dockerfile CHANGED
@@ -1,12 +1,14 @@
1
- # Use an official lightweight Python image
2
  FROM python:3.9
3
 
 
 
 
 
4
  # Create a non-root user and switch to it
5
  RUN useradd -m -u 1000 user
6
  USER user
7
  ENV PATH="/home/user/.local/bin:$PATH"
8
 
9
- # Set working directory
10
  WORKDIR /app
11
 
12
  # Copy requirements and install dependencies
@@ -16,5 +18,5 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
16
  # Copy the application code
17
  COPY --chown=user . /app
18
 
19
- # Command to run the FastAPI app
20
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.9
2
 
3
+ # Install system dependencies, including libGL
4
+ USER root
5
+ RUN apt-get update && apt-get install -y libgl1-mesa-glx
6
+
7
  # Create a non-root user and switch to it
8
  RUN useradd -m -u 1000 user
9
  USER user
10
  ENV PATH="/home/user/.local/bin:$PATH"
11
 
 
12
  WORKDIR /app
13
 
14
  # Copy requirements and install dependencies
 
18
  # Copy the application code
19
  COPY --chown=user . /app
20
 
21
+ # Run the FastAPI app with Uvicorn
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]