Update Dockerfile
Browse files- Dockerfile +13 -6
Dockerfile
CHANGED
|
@@ -1,12 +1,19 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
COPY . .
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
RUN pip install fastapi uvicorn
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
|
| 1 |
+
# -------------------------------------------------
|
| 2 |
+
# Use the official HF Python image (includes sudo)
|
| 3 |
+
# -------------------------------------------------
|
| 4 |
+
FROM python:3.12-slim
|
| 5 |
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
+
# Install only what we need
|
| 9 |
+
COPY requirements.txt .
|
| 10 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
| 12 |
+
COPY main.py .
|
|
|
|
| 13 |
|
| 14 |
+
EXPOSE 8000
|
| 15 |
+
|
| 16 |
+
# Raw sockets need CAP_NET_RAW + CAP_NET_ADMIN
|
| 17 |
+
# Hugging Face Spaces runs containers with --cap-add automatically,
|
| 18 |
+
# but for local testing add them manually.
|
| 19 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|