Update Dockerfile
Browse files- Dockerfile +14 -6
Dockerfile
CHANGED
|
@@ -2,7 +2,7 @@ FROM python:3.10-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
libgl1 \
|
| 8 |
libglib2.0-0 \
|
|
@@ -13,17 +13,25 @@ RUN apt-get update && apt-get install -y \
|
|
| 13 |
wget \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
|
|
|
| 16 |
COPY requirements.txt .
|
| 17 |
|
| 18 |
-
# Install
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
-
# Install CPU-only
|
| 22 |
-
RUN pip install --no-cache-dir torch==2.
|
| 23 |
-
RUN pip install --no-cache-dir torchvision==0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
# Install remaining packages
|
| 26 |
-
RUN pip install --no-cache-dir
|
| 27 |
|
| 28 |
COPY . .
|
| 29 |
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
libgl1 \
|
| 8 |
libglib2.0-0 \
|
|
|
|
| 13 |
wget \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# Copy requirements first for better caching
|
| 17 |
COPY requirements.txt .
|
| 18 |
|
| 19 |
+
# Install base dependencies
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
+
# Install CPU-only PyTorch (from official source)
|
| 23 |
+
RUN pip install --no-cache-dir torch==2.0.1 --index-url https://download.pytorch.org/whl/cpu
|
| 24 |
+
RUN pip install --no-cache-dir torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cpu
|
| 25 |
+
|
| 26 |
+
# Install Hugging Face ecosystem with compatible versions
|
| 27 |
+
RUN pip install --no-cache-dir transformers==4.30.2
|
| 28 |
+
RUN pip install --no-cache-dir sentence-transformers==2.2.2
|
| 29 |
+
RUN pip install --no-cache-dir accelerate==0.21.0
|
| 30 |
+
RUN pip install --no-cache-dir tokenizers==0.13.3
|
| 31 |
+
RUN pip install --no-cache-dir huggingface-hub==0.16.4
|
| 32 |
|
| 33 |
# Install remaining packages
|
| 34 |
+
RUN pip install --no-cache-dir scikit-image==0.21.0 scipy==1.10.1 httpx==0.24.1 aiofiles==23.2.1
|
| 35 |
|
| 36 |
COPY . .
|
| 37 |
|