Tantawi65 commited on
Commit
b3b5948
·
1 Parent(s): d82a135

Fix: Simplify Dockerfile and requirements for HF Spaces compatibility

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -12
  2. requirements.txt +6 -8
Dockerfile CHANGED
@@ -1,23 +1,14 @@
1
- FROM python:3.9
2
 
3
  # Set working directory
4
  WORKDIR /code
5
 
6
- # Install system dependencies for OpenCV and TensorFlow
7
- RUN apt-get update && apt-get install -y \
8
- libglib2.0-0 \
9
- libsm6 \
10
- libxext6 \
11
- libxrender-dev \
12
- libgomp1 \
13
- libgl1-mesa-glx \
14
- && rm -rf /var/lib/apt/lists/*
15
-
16
  # Copy requirements first for better caching
17
  COPY ./requirements.txt /code/requirements.txt
18
 
19
  # Install Python dependencies
20
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
21
 
22
  # Copy application code
23
  COPY . /code
 
1
+ FROM python:3.8
2
 
3
  # Set working directory
4
  WORKDIR /code
5
 
 
 
 
 
 
 
 
 
 
 
6
  # Copy requirements first for better caching
7
  COPY ./requirements.txt /code/requirements.txt
8
 
9
  # Install Python dependencies
10
+ RUN pip install --no-cache-dir --upgrade pip && \
11
+ pip install --no-cache-dir -r /code/requirements.txt
12
 
13
  # Copy application code
14
  COPY . /code
requirements.txt CHANGED
@@ -1,8 +1,6 @@
1
- fastapi==0.104.1
2
- uvicorn[standard]==0.24.0
3
- pydantic==2.5.0
4
- python-multipart==0.0.6
5
- numpy==1.26.0
6
- Pillow==10.0.0
7
- tensorflow==2.15.0
8
- opencv-python-headless==4.8.0.76
 
1
+ fastapi
2
+ uvicorn[standard]
3
+ python-multipart
4
+ numpy
5
+ Pillow
6
+ tensorflow==2.10.0