File size: 1,387 Bytes
11961c3
 
 
 
 
 
 
 
 
 
 
 
3344d7f
 
 
 
 
11961c3
840b917
 
 
 
11961c3
c262c6f
04267d2
11961c3
 
3344d7f
 
 
 
11961c3
 
 
 
06b1a82
 
11961c3
 
 
 
 
 
3344d7f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Use Python 3.11 slim image as base
FROM python:3.11-slim

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Copy vader_mcp folder (matching ObsPy structure)
COPY vader_mcp /app/vader_mcp

# Copy MCP service requirements
COPY vader_mcp/mcp_output/requirements.txt /app/requirements.txt

# Install Python dependencies with explicit version check
RUN pip install --no-cache-dir -r /app/requirements.txt && \
    pip list | grep fastmcp && \
    python -c "import fastmcp; print(f'FastMCP version installed: {fastmcp.__version__}')"

# Note: FastAPI and Uvicorn are already included as dependencies of fastmcp
# DO NOT reinstall them separately as it may upgrade fastmcp to a newer version

# Create output directories with write permissions
RUN mkdir -p /app/vader_mcp/mcp_output/mcp_logs \
    /app/vader_mcp/mcp_output/output \
    && chmod -R 777 /app/vader_mcp/mcp_output/mcp_logs \
    && chmod -R 777 /app/vader_mcp/mcp_output/output

# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV MCP_TRANSPORT=http
# Hugging Face Space uses PORT env var, default to 7860
ENV PORT=7860
ENV MCP_PORT=7860

# Expose port (Hugging Face uses 7860 by default)
EXPOSE 7860

# Start MCP service in HTTP mode
CMD ["python", "/app/vader_mcp/mcp_output/start_mcp.py"]