mahmoudelsheemy commited on
Commit
4732db2
·
1 Parent(s): 81b3c47

Update Dockerfile to force pip upgrade and clean install

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -15
Dockerfile CHANGED
@@ -2,29 +2,30 @@
2
 
3
  WORKDIR /app
4
 
5
- # Install minimal system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  libgl1 \
8
  libglib2.0-0 \
 
 
 
 
 
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Copy requirements
12
  COPY requirements.txt .
13
 
14
- # Install packages one by one to see which fails
15
- RUN pip install --no-cache-dir fastapi==0.104.1
16
- RUN pip install --no-cache-dir uvicorn==0.24.0
17
- RUN pip install --no-cache-dir tensorflow==2.13.0
18
- RUN pip install --no-cache-dir transformers==4.35.0
19
- RUN pip install --no-cache-dir torch==2.1.0
20
- RUN pip install --no-cache-dir Pillow==10.1.0
21
- RUN pip install --no-cache-dir numpy==1.24.3
22
- RUN pip install --no-cache-dir gdown==4.7.1
23
- RUN pip install --no-cache-dir pyheif==0.7.1
24
- RUN pip install --no-cache-dir python-multipart==0.0.6
25
- RUN pip install --no-cache-dir pydantic==2.4.2
26
 
 
27
  COPY . .
28
 
 
29
  EXPOSE 7860
30
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  libgl1 \
8
  libglib2.0-0 \
9
+ libsm6 \
10
+ libxext6 \
11
+ libxrender1 \
12
+ libgomp1 \
13
+ libheif-dev \
14
+ ffmpeg \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # Copy requirements first for better caching
18
  COPY requirements.txt .
19
 
20
+ # Upgrade pip and install dependencies
21
+ RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
22
+ pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
 
23
 
24
+ # Copy the rest of the application
25
  COPY . .
26
 
27
+ # Expose port
28
  EXPOSE 7860
29
+
30
+ # Run the application
31
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]