Update Dockerfile
Browse files- Dockerfile +20 -8
Dockerfile
CHANGED
|
@@ -12,10 +12,10 @@ RUN sed -i 's/main/main contrib non-free/' /etc/apt/sources.list && \
|
|
| 12 |
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
-
# Install
|
| 16 |
-
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
| 17 |
|
| 18 |
-
# Install CPU-only PyTorch and compatible NumPy
|
| 19 |
RUN pip install --no-cache-dir \
|
| 20 |
"numpy<2" \
|
| 21 |
torch==2.1.2+cpu \
|
|
@@ -23,12 +23,24 @@ RUN pip install --no-cache-dir \
|
|
| 23 |
torchaudio==2.1.2+cpu \
|
| 24 |
--index-url https://download.pytorch.org/whl/cpu
|
| 25 |
|
| 26 |
-
#
|
| 27 |
COPY requirements.txt .
|
| 28 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
# Copy application code
|
| 34 |
COPY . .
|
|
|
|
| 12 |
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
+
# Install core dependencies first
|
| 16 |
+
RUN pip install --no-cache-dir --upgrade pip setuptools wheel packaging
|
| 17 |
|
| 18 |
+
# Install CPU-only PyTorch and compatible NumPy
|
| 19 |
RUN pip install --no-cache-dir \
|
| 20 |
"numpy<2" \
|
| 21 |
torch==2.1.2+cpu \
|
|
|
|
| 23 |
torchaudio==2.1.2+cpu \
|
| 24 |
--index-url https://download.pytorch.org/whl/cpu
|
| 25 |
|
| 26 |
+
# Copy requirements and install with flash_attn workaround
|
| 27 |
COPY requirements.txt .
|
| 28 |
+
RUN pip install --no-cache-dir -r requirements.txt --no-deps && \
|
| 29 |
+
pip install --no-cache-dir \
|
| 30 |
+
accelerate \
|
| 31 |
+
transformers==4.36.2 \
|
| 32 |
+
timm==0.9.12 \
|
| 33 |
+
einops==0.7.0
|
| 34 |
+
|
| 35 |
+
# Install remaining packages
|
| 36 |
+
RUN pip install --no-cache-dir \
|
| 37 |
+
fastapi \
|
| 38 |
+
uvicorn \
|
| 39 |
+
opencv-python-headless \
|
| 40 |
+
pathlib \
|
| 41 |
+
huggingface_hub \
|
| 42 |
+
pillow \
|
| 43 |
+
rarfile
|
| 44 |
|
| 45 |
# Copy application code
|
| 46 |
COPY . .
|