Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +1 -5
Dockerfile
CHANGED
|
@@ -2,27 +2,23 @@ FROM python:3.10-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# System deps for Pillow
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
libjpeg-dev \
|
| 9 |
zlib1g-dev \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
#
|
| 13 |
RUN pip install --no-cache-dir \
|
| 14 |
torch==2.2.2+cpu \
|
| 15 |
torchvision==0.17.2+cpu \
|
| 16 |
--index-url https://download.pytorch.org/whl/cpu
|
| 17 |
|
| 18 |
-
# Copy requirements and install the rest
|
| 19 |
COPY requirements.txt /app/requirements.txt
|
| 20 |
RUN pip install --no-cache-dir -r /app/requirements.txt
|
| 21 |
|
| 22 |
-
# Copy code and model
|
| 23 |
COPY . /app
|
| 24 |
|
| 25 |
-
# Hugging Face Spaces require listening on port 7860
|
| 26 |
EXPOSE 7860
|
| 27 |
|
| 28 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
libjpeg-dev \
|
| 8 |
zlib1g-dev \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
+
# CPU-only torch
|
| 12 |
RUN pip install --no-cache-dir \
|
| 13 |
torch==2.2.2+cpu \
|
| 14 |
torchvision==0.17.2+cpu \
|
| 15 |
--index-url https://download.pytorch.org/whl/cpu
|
| 16 |
|
|
|
|
| 17 |
COPY requirements.txt /app/requirements.txt
|
| 18 |
RUN pip install --no-cache-dir -r /app/requirements.txt
|
| 19 |
|
|
|
|
| 20 |
COPY . /app
|
| 21 |
|
|
|
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|