File size: 1,378 Bytes
5aaa204
 
 
 
 
 
 
7839667
5aaa204
b26ebe1
5aaa204
7839667
 
 
42599d1
b26ebe1
 
 
 
 
 
 
 
 
 
 
 
5aaa204
b26ebe1
5aaa204
 
 
 
 
 
 
42599d1
 
 
 
b26ebe1
5aaa204
 
 
 
 
 
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
46
47
FROM alpine

WORKDIR /app

# Install dependencies
RUN apk add --no-cache python3 py3-pip git py3-uv nodejs npm

# Clone One-MCP first
RUN git clone https://github.com/One-MCP/multi-mcp.git .
RUN uv venv && . .venv/bin/activate && uv pip install -r requirements.txt

# Create writable directory for mcp-remote auth configs AFTER git clone
RUN mkdir -p /app/.mcp-auth && chmod 777 /app/.mcp-auth

# Copy requirements and create venvs
COPY tools/requirements/ /tmp/requirements/
RUN python3 -m venv /app/venvs/shared
RUN /app/venvs/shared/bin/pip install -r /tmp/requirements/shared.txt
RUN for req in /tmp/requirements/*.txt; do \
      name=$(basename "$req" .txt); \
      if [ "$name" != "shared" ]; then \
        python3 -m venv "/app/venvs/$name"; \
        "/app/venvs/$name/bin/pip" install -r "$req"; \
      fi; \
    done

# Copy tools and config
COPY tools/ /app/tools/
COPY mcp.json /app/mcp.json

# Cache directories
RUN mkdir /app/.uv-cache && chmod -R 777 /app/.uv-cache
ENV UV_CACHE_DIR=/app/.uv-cache
RUN mkdir /app/.npm-cache && chmod -R 777 /app/.npm-cache
ENV npm_config_cache=/app/.npm-cache

# Set home directory for mcp-remote configs
ENV HOME=/app
ENV MCP_CONFIG_DIR=/app/.mcp-auth

# One-MCP settings
ENV CONFIG=/app/mcp.json
ENV TRANSPORT=sse
ENV USE_NAMESPACE=True

EXPOSE 7860
CMD ["/app/.venv/bin/hypercorn", "src.main:app", "--bind", "0.0.0.0:7860"]