Update Dockerfile
Browse files- Dockerfile +18 -20
Dockerfile
CHANGED
|
@@ -1,20 +1,18 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM python:3.11-slim
|
| 3 |
-
|
| 4 |
-
# Set working directory
|
| 5 |
-
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
# Copy requirements
|
| 8 |
-
COPY requirements.txt .
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
# Run FastAPI server
|
| 20 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use official slim Python image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy requirements and install
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
| 10 |
+
|
| 11 |
+
# Copy app.py
|
| 12 |
+
COPY . .
|
| 13 |
+
|
| 14 |
+
# Expose default HF port
|
| 15 |
+
EXPOSE 7860
|
| 16 |
+
|
| 17 |
+
# Use Python to run uvicorn (avoids PATH issues)
|
| 18 |
+
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|