Charuka66 commited on
Commit
85f8047
·
verified ·
1 Parent(s): 4794afe

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -6
Dockerfile CHANGED
@@ -1,13 +1,14 @@
1
- # Start with a lightweight Python Linux system
2
  FROM python:3.9-slim
3
 
4
  # Set the working directory
5
  WORKDIR /code
6
 
7
- # 1. Install the missing system libraries (The "Fix")
8
- # We force install libgl1 and libglib2.0 which OpenCV needs
9
  RUN apt-get update && apt-get install -y \
10
- libgl1-mesa-glx \
 
11
  libglib2.0-0 \
12
  && rm -rf /var/lib/apt/lists/*
13
 
@@ -15,7 +16,6 @@ RUN apt-get update && apt-get install -y \
15
  COPY ./requirements.txt /code/requirements.txt
16
 
17
  # 3. Install Python libraries
18
- # We use --no-cache-dir to keep the setup light
19
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
20
 
21
  # 4. Copy your code and model
@@ -25,5 +25,4 @@ COPY . .
25
  RUN mkdir -p /code/uploads && chmod 777 /code/uploads
26
 
27
  # 6. Start the server
28
- # Note: Hugging Face expects port 7860
29
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Start with a lightweight Python version
2
  FROM python:3.9-slim
3
 
4
  # Set the working directory
5
  WORKDIR /code
6
 
7
+ # 1. Install System Dependencies
8
+ # FIX: Removed 'libgl1-mesa-glx' (obsolete). Added 'libgl1' and 'libglx-mesa0'.
9
  RUN apt-get update && apt-get install -y \
10
+ libgl1 \
11
+ libglx-mesa0 \
12
  libglib2.0-0 \
13
  && rm -rf /var/lib/apt/lists/*
14
 
 
16
  COPY ./requirements.txt /code/requirements.txt
17
 
18
  # 3. Install Python libraries
 
19
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
20
 
21
  # 4. Copy your code and model
 
25
  RUN mkdir -p /code/uploads && chmod 777 /code/uploads
26
 
27
  # 6. Start the server
 
28
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]