Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -3
Dockerfile
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 7 |
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
+
# Use a lightweight Python base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Set working directory inside container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy the requirements file
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
|
| 10 |
+
# Install dependencies
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# Copy the rest of the app files
|
| 14 |
+
COPY . .
|
| 15 |
+
|
| 16 |
+
# Expose port for FastAPI (Hugging Face uses 7860 by default)
|
| 17 |
+
EXPOSE 7860
|
| 18 |
|
| 19 |
+
# Start FastAPI server
|
| 20 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|