Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +3 -10
Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
@@ -8,20 +8,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
RUN pip install --no-cache-dir --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 |
-
# Copy and install requirements
|
| 18 |
COPY requirements.txt .
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
# Copy app
|
| 22 |
COPY app.py .
|
| 23 |
|
| 24 |
-
# HF expects the app to be at /app/app.py and will run it
|
| 25 |
ENV GRADIO_SERVER_NAME=0.0.0.0
|
| 26 |
ENV GRADIO_SERVER_PORT=7860
|
| 27 |
ENV PYTHONUNBUFFERED=1
|
|
|
|
| 1 |
+
# Use official PyTorch CPU image (includes torch, torchvision, torchaudio pre-installed)
|
| 2 |
+
FROM pytorch/pytorch:2.4.0-cpu
|
| 3 |
|
| 4 |
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
+
# Copy and install additional Python dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
COPY requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
# Copy app
|
| 16 |
COPY app.py .
|
| 17 |
|
|
|
|
| 18 |
ENV GRADIO_SERVER_NAME=0.0.0.0
|
| 19 |
ENV GRADIO_SERVER_PORT=7860
|
| 20 |
ENV PYTHONUNBUFFERED=1
|