Spaces:
Paused
Paused
fix: correct runtime config for HF Spaces
Browse files- Dockerfile +20 -0
- huggingface.yaml +1 -3
Dockerfile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
# Set working directory
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# System dependencies (optional, include if needed)
|
| 7 |
+
# RUN apt-get update && apt-get install -y libgl1-mesa-glx
|
| 8 |
+
|
| 9 |
+
# Copy and install requirements
|
| 10 |
+
COPY requirements.txt .
|
| 11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
+
|
| 13 |
+
# Copy entire project
|
| 14 |
+
COPY . .
|
| 15 |
+
|
| 16 |
+
# Expose FastAPI default port
|
| 17 |
+
EXPOSE 7860
|
| 18 |
+
|
| 19 |
+
# Run FastAPI with uvicorn (you can change --host/--port as needed)
|
| 20 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
huggingface.yaml
CHANGED
|
@@ -1,3 +1 @@
|
|
| 1 |
-
sdk:
|
| 2 |
-
app_file: "main.py"
|
| 3 |
-
python_version: "3.12.8" # or another if needed
|
|
|
|
| 1 |
+
sdk: docker
|
|
|
|
|
|