Spaces:
Running
Running
Upload Dockerfile
Browse files- Dockerfile +5 -5
Dockerfile
CHANGED
|
@@ -2,21 +2,21 @@ FROM python:3.9-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
build-essential \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
COPY requirements.txt .
|
| 11 |
|
| 12 |
-
# Install CPU-only torch to save space
|
| 13 |
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
COPY . .
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
ENV PORT=
|
| 20 |
|
| 21 |
# Command to run the app
|
| 22 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
build-essential \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
COPY requirements.txt .
|
| 11 |
|
| 12 |
+
# Install CPU-only torch to save space
|
| 13 |
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
COPY . .
|
| 17 |
|
| 18 |
+
# Hugging Face Spaces serves on port 7860 by default
|
| 19 |
+
ENV PORT=7860
|
| 20 |
|
| 21 |
# Command to run the app
|
| 22 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|