Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- Dockerfile +8 -4
- README.md +1 -1
- start.sh +14 -0
Dockerfile
CHANGED
|
@@ -8,8 +8,12 @@ COPY . .
|
|
| 8 |
# Install Python dependencies
|
| 9 |
RUN pip install --no-cache-dir -e .
|
| 10 |
|
| 11 |
-
# Expose
|
| 12 |
-
EXPOSE 7860
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
# Install Python dependencies
|
| 9 |
RUN pip install --no-cache-dir -e .
|
| 10 |
|
| 11 |
+
# Expose ports
|
| 12 |
+
EXPOSE 7860 7861
|
| 13 |
|
| 14 |
+
# Copy startup script
|
| 15 |
+
COPY start.sh /app/start.sh
|
| 16 |
+
RUN chmod +x /app/start.sh
|
| 17 |
+
|
| 18 |
+
# Run both backend and UI
|
| 19 |
+
CMD ["/app/start.sh"]
|
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 🔧
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: docker
|
| 7 |
-
app_file:
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
|
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: indigo
|
| 6 |
sdk: docker
|
| 7 |
+
app_file: ui.py
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
start.sh
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Start both the FastAPI backend and Gradio UI
|
| 3 |
+
|
| 4 |
+
# Start FastAPI server in background on port 7861
|
| 5 |
+
echo "Starting FastAPI backend on port 7861..."
|
| 6 |
+
uvicorn server.app:app --host 0.0.0.0 --port 7861 &
|
| 7 |
+
BACKEND_PID=$!
|
| 8 |
+
|
| 9 |
+
# Wait for backend to be ready
|
| 10 |
+
sleep 2
|
| 11 |
+
|
| 12 |
+
# Start Gradio UI on port 7860 (foreground)
|
| 13 |
+
echo "Starting Gradio UI on port 7860..."
|
| 14 |
+
exec python ui.py
|