PUSHPENDAR commited on
Commit
0ebf7b1
·
verified ·
1 Parent(s): f0ca182

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -7
Dockerfile CHANGED
@@ -1,28 +1,34 @@
1
- FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-runtime
2
 
3
  WORKDIR /app
4
 
5
- # Prevent timezone prompt during apt-get
6
  ENV DEBIAN_FRONTEND=noninteractive
7
  ENV TZ=UTC
8
 
9
  # System deps
10
  RUN apt-get update && apt-get install -y \
11
- git gcc g++ ninja-build \
12
  libglib2.0-0 libsm6 libxext6 \
13
  libgl1-mesa-glx libgomp1 \
 
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # Install detectron2 prebuilt wheel (matches torch 2.1.0 + cuda 11.8)
17
  RUN pip install --no-cache-dir \
18
- detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu118/torch2.1/index.html
 
 
19
 
20
- # Other deps
 
 
 
 
21
  RUN pip install --no-cache-dir \
22
  gradio==4.44.0 \
23
  opencv-python-headless \
24
  Pillow \
25
- numpy==1.26.4 \
26
  huggingface_hub
27
 
28
  COPY app.py .
 
1
+ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
 
5
  ENV DEBIAN_FRONTEND=noninteractive
6
  ENV TZ=UTC
7
 
8
  # System deps
9
  RUN apt-get update && apt-get install -y \
10
+ git gcc g++ ninja-build cmake \
11
  libglib2.0-0 libsm6 libxext6 \
12
  libgl1-mesa-glx libgomp1 \
13
+ python3-dev \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
+ # STEP 1: torch CPU only (much smaller, no CUDA needed on free tier)
17
  RUN pip install --no-cache-dir \
18
+ torch==2.1.0+cpu \
19
+ torchvision==0.16.0+cpu \
20
+ --index-url https://download.pytorch.org/whl/cpu
21
 
22
+ # STEP 2: detectron2 CPU prebuilt wheel (matches torch 2.1.0 cpu)
23
+ RUN pip install --no-cache-dir \
24
+ detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch2.1/index.html
25
+
26
+ # STEP 3: everything else
27
  RUN pip install --no-cache-dir \
28
  gradio==4.44.0 \
29
  opencv-python-headless \
30
  Pillow \
31
+ "numpy<2" \
32
  huggingface_hub
33
 
34
  COPY app.py .