BugFreeAli commited on
Commit
5b939ff
·
verified ·
1 Parent(s): 411cb60

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -6
Dockerfile CHANGED
@@ -4,26 +4,27 @@ FROM python:3.10-slim
4
  # 2. Set working directory
5
  WORKDIR /app
6
 
7
- # 3. Install system dependencies (Required for OpenCV/TensorFlow image processing)
 
8
  RUN apt-get update && apt-get install -y \
9
- libgl1-mesa-glx \
10
  libglib2.0-0 \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # 4. Create a non-root user (CRITICAL: Hugging Face requires this!)
14
  RUN useradd -m -u 1000 user
15
  USER user
16
  ENV PATH="/home/user/.local/bin:$PATH"
17
 
18
- # 5. Copy files with correct permissions
19
  COPY --chown=user . .
20
 
21
  # 6. Install Python Dependencies
22
  RUN pip install --no-cache-dir --upgrade pip && \
23
  pip install --no-cache-dir -r requirements.txt
24
 
25
- # 7. Expose the specific Hugging Face Port
26
  EXPOSE 7860
27
 
28
- # 8. Run the app on Port 7860
29
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
4
  # 2. Set working directory
5
  WORKDIR /app
6
 
7
+ # 3. Install system dependencies
8
+ # FIX: 'libgl1-mesa-glx' is renamed to 'libgl1' in newer Linux versions
9
  RUN apt-get update && apt-get install -y \
10
+ libgl1 \
11
  libglib2.0-0 \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # 4. Create a non-root user (Hugging Face requirement)
15
  RUN useradd -m -u 1000 user
16
  USER user
17
  ENV PATH="/home/user/.local/bin:$PATH"
18
 
19
+ # 5. Copy files with permissions
20
  COPY --chown=user . .
21
 
22
  # 6. Install Python Dependencies
23
  RUN pip install --no-cache-dir --upgrade pip && \
24
  pip install --no-cache-dir -r requirements.txt
25
 
26
+ # 7. Expose Port
27
  EXPOSE 7860
28
 
29
+ # 8. Run App
30
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]