Anasbf commited on
Commit
373d68a
·
verified ·
1 Parent(s): f8982fc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -7
Dockerfile CHANGED
@@ -1,22 +1,30 @@
1
  FROM python:3.10-slim
2
 
3
-
4
  WORKDIR /app
5
 
 
 
 
 
 
 
 
 
6
 
 
7
  COPY requirements.txt .
8
-
9
-
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
-
13
  COPY . .
14
 
15
- # Expose the port 7860
16
  EXPOSE 7860
17
 
18
- # environment variables
19
  ENV GRADIO_SERVER_NAME=0.0.0.0
20
 
21
  # Run the Gradio app
22
- CMD ["python", "app.py"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Set working directory
4
  WORKDIR /app
5
 
6
+ # Install system dependencies needed by OpenCV and other packages
7
+ RUN apt-get update && apt-get install -y --no-install-recommends \
8
+ libgl1 \
9
+ libglib2.0-0 \
10
+ libsm6 \
11
+ libxext6 \
12
+ libxrender-dev \
13
+ && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Copy and install Python dependencies
16
  COPY requirements.txt .
17
+ RUN pip install --no-cache-dir --upgrade pip setuptools wheel
 
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # Copy application code
21
  COPY . .
22
 
23
+ # Expose Gradio's default port
24
  EXPOSE 7860
25
 
26
+ # Set environment variable for Gradio
27
  ENV GRADIO_SERVER_NAME=0.0.0.0
28
 
29
  # Run the Gradio app
30
+ CMD ["python", "app.py"]