Mandark-droid commited on
Commit
2f35f0d
·
1 Parent(s): 8a6de74

feat: Use Docker SDK with fresh environment for Gradio 6.0.0.dev4

Browse files

Following Gradio team's recommendation to use a fresh virtual environment,
switching from Gradio SDK to Docker SDK to avoid HF Spaces infrastructure
conflicts with mcp package versions.

Changes:
- Add Dockerfile with fresh Python 3.10 environment
- Install gradio[mcp,oauth]==6.0.0.dev4 in Dockerfile (separate from requirements.txt)
- Change README frontmatter: sdk: docker (was sdk: gradio)
- Remove gradio from requirements.txt (now in Dockerfile)

This bypasses HF Spaces' hardcoded 'mcp==1.8.1' installation which
conflicts with Gradio 6's requirement of 'mcp>=1.21.0'.

Docker SDK gives us full control over installation order and ensures
a fresh environment as recommended by Gradio developers.

Expected result: Successful build with Gradio 6 and working MCP tools!

Files changed (3) hide show
  1. Dockerfile +40 -0
  2. README.md +1 -2
  3. requirements.txt +1 -1
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python 3.10 base image
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ git \
10
+ git-lfs \
11
+ ffmpeg \
12
+ libsm6 \
13
+ libxext6 \
14
+ cmake \
15
+ rsync \
16
+ libgl1 \
17
+ && rm -rf /var/lib/apt/lists/* \
18
+ && git lfs install
19
+
20
+ # Copy requirements first (for better caching)
21
+ COPY requirements.txt .
22
+
23
+ # Fresh install of Gradio 6 as recommended by Gradio team
24
+ # Install in a single command to avoid conflicts
25
+ RUN pip install --no-cache-dir --upgrade pip && \
26
+ pip install --no-cache-dir "gradio[mcp,oauth]==6.0.0.dev4" && \
27
+ pip install --no-cache-dir -r requirements.txt
28
+
29
+ # Copy application code
30
+ COPY . .
31
+
32
+ # Expose port
33
+ EXPOSE 7860
34
+
35
+ # Set environment variables
36
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
37
+ ENV GRADIO_SERVER_PORT=7860
38
+
39
+ # Run the application
40
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -3,8 +3,7 @@ title: TraceMind MCP Server
3
  emoji: 🤖
4
  colorFrom: blue
5
  colorTo: purple
6
- sdk: gradio
7
- sdk_version: 5.49.1
8
  app_port: 7860
9
  pinned: false
10
  license: agpl-3.0
 
3
  emoji: 🤖
4
  colorFrom: blue
5
  colorTo: purple
6
+ sdk: docker
 
7
  app_port: 7860
8
  pinned: false
9
  license: agpl-3.0
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  # Core dependencies
2
- gradio[mcp]==5.49.1
3
  google-generativeai>=0.8.0
4
  datasets>=2.14.0
5
  pandas>=2.0.0
 
1
  # Core dependencies
2
+ # Note: gradio is installed separately in Dockerfile to avoid HF Spaces conflicts
3
  google-generativeai>=0.8.0
4
  datasets>=2.14.0
5
  pandas>=2.0.0