aizerner commited on
Commit
20489eb
·
1 Parent(s): a3a4834

Updated files

Browse files
Files changed (2) hide show
  1. Dockerfile +10 -5
  2. requirements.txt +0 -0
Dockerfile CHANGED
@@ -1,22 +1,27 @@
1
  FROM python:3.10-slim
2
 
3
- # Install only the system libraries OpenCV-headless actually needs
4
  RUN apt-get update && apt-get install -y \
5
  libgl1-mesa-glx \
6
  libglib2.0-0 \
 
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
  WORKDIR /app
10
 
11
- # Copy and install Python requirements
 
 
 
 
 
 
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # Copy your entire project (main.py is in the root → this works perfectly)
16
  COPY . .
17
 
18
- # Expose port (HF Spaces uses 7860 by default, but 8000 also works)
19
  EXPOSE 7860
20
 
21
- # Run exactly what you run locally
22
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ # System libraries needed by OpenCV + PyTorch CPU + Gemini
4
  RUN apt-get update && apt-get install -y \
5
  libgl1-mesa-glx \
6
  libglib2.0-0 \
7
+ libgomp1 \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
  WORKDIR /app
11
 
12
+ # Install PyTorch first from official index (fast & reliable CPU wheels)
13
+ RUN pip install --no-cache-dir --upgrade pip && \
14
+ pip install --no-cache-dir \
15
+ torch==2.4.1 torchvision==0.19.1 \
16
+ --index-url https://download.pytorch.org/whl/cpu
17
+
18
+ # Install everything else
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Copy your code
23
  COPY . .
24
 
 
25
  EXPOSE 7860
26
 
 
27
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ