Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +15 -6
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
#
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
@@ -7,15 +7,24 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 7 |
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
-
# Install PyTorch CPU
|
| 11 |
-
RUN pip install --no-cache-dir --
|
|
|
|
| 12 |
torch==2.4.0 \
|
| 13 |
torchvision==0.19.0 \
|
| 14 |
torchaudio==2.4.0
|
| 15 |
|
| 16 |
-
# Install
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
COPY app.py .
|
| 21 |
|
|
|
|
| 1 |
+
# Optimized build with split installs and pip options
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
| 7 |
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
+
# Install PyTorch CPU with longer timeout
|
| 11 |
+
RUN pip install --no-cache-dir --timeout=300 --retries=3 --prefer-binary \
|
| 12 |
+
--index-url https://download.pytorch.org/whl/cpu \
|
| 13 |
torch==2.4.0 \
|
| 14 |
torchvision==0.19.0 \
|
| 15 |
torchaudio==2.4.0
|
| 16 |
|
| 17 |
+
# Install core ML deps
|
| 18 |
+
RUN pip install --no-cache-dir --timeout=300 --retries=3 --prefer-binary \
|
| 19 |
+
diffusers==0.31.0 \
|
| 20 |
+
transformers==4.44.0 \
|
| 21 |
+
accelerate==0.33.0 \
|
| 22 |
+
safetensors==0.4.4
|
| 23 |
+
|
| 24 |
+
# Install remaining
|
| 25 |
+
RUN pip install --no-cache-dir --timeout=300 --retries=3 --prefer-binary \
|
| 26 |
+
pillow==10.4.0 \
|
| 27 |
+
huggingface_hub==0.23.4
|
| 28 |
|
| 29 |
COPY app.py .
|
| 30 |
|