mrmarvelous commited on
Commit
3cb0679
·
verified ·
1 Parent(s): 5bce26d

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. Dockerfile +8 -4
  2. README.md +1 -1
  3. 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 port
12
- EXPOSE 7860
13
 
14
- # Run server
15
- CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
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: server/app.py
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