Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +5 -9
Dockerfile
CHANGED
|
@@ -1,20 +1,16 @@
|
|
| 1 |
# Dockerfile
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
# WORKDIR /app
|
| 6 |
RUN apt-get update && apt-get install -y socat && rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
#
|
| 9 |
COPY requirements.txt .
|
| 10 |
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
-
# Expose the port that uvicorn will listen on (Hugging Face Spaces uses port 7860)
|
| 16 |
EXPOSE 7860
|
| 17 |
-
|
| 18 |
-
# Start the FastAPI app with uvicorn
|
| 19 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 20 |
-
# CMD ["python", "app.py"]
|
|
|
|
| 1 |
# Dockerfile
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# 1) system deps
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y socat && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
+
# 2) python deps
|
| 8 |
COPY requirements.txt .
|
| 9 |
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
# 3) application code -> writable layer
|
| 12 |
+
WORKDIR /app # ← writable because it’s created now
|
| 13 |
+
COPY . . # app.py will be /app/app.py
|
| 14 |
|
|
|
|
| 15 |
EXPOSE 7860
|
|
|
|
|
|
|
| 16 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|