AbhinavGupta commited on
Commit
fdbecd2
Β·
verified Β·
1 Parent(s): 9c7a52a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -12
Dockerfile CHANGED
@@ -1,11 +1,7 @@
1
  FROM python:3.10-slim
2
 
3
  RUN apt-get update && apt-get install -y \
4
- libgl1 \
5
- libglib2.0-0 \
6
- libsm6 \
7
- libxext6 \
8
- libxrender-dev \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  RUN useradd -m -u 1000 user
@@ -15,14 +11,13 @@ WORKDIR /app
15
 
16
  COPY --chown=user requirements.txt .
17
 
18
- # ── Install PyTorch CPU FIRST, explicitly, before everything else ──
19
  RUN pip install --no-cache-dir \
20
- torch==2.3.0+cpu \
21
- torchvision==0.18.0+cpu \
22
- --index-url https://download.pytorch.org/whl/cpu
23
-
24
- # ── Then install the rest ──
25
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
26
 
27
  COPY --chown=user . .
28
  EXPOSE 7860
 
1
  FROM python:3.10-slim
2
 
3
  RUN apt-get update && apt-get install -y \
4
+ libgl1 libglib2.0-0 libsm6 libxext6 libxrender-dev \
 
 
 
 
5
  && rm -rf /var/lib/apt/lists/*
6
 
7
  RUN useradd -m -u 1000 user
 
11
 
12
  COPY --chown=user requirements.txt .
13
 
14
+ # ── Single chained command β€” prevents partial cache hits ──
15
  RUN pip install --no-cache-dir \
16
+ torch==2.3.0+cpu \
17
+ torchvision==0.18.0+cpu \
18
+ --index-url https://download.pytorch.org/whl/cpu \
19
+ && pip install --no-cache-dir -r requirements.txt \
20
+ && python -c "import torch; import torchvision; print('βœ… torch', torch.__version__, '| torchvision', torchvision.__version__)"
 
21
 
22
  COPY --chown=user . .
23
  EXPOSE 7860