Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +21 -6
Dockerfile
CHANGED
|
@@ -7,12 +7,28 @@ RUN apk add --no-cache python3 py3-pip git py3-uv nodejs npm
|
|
| 7 |
|
| 8 |
# Clone One-MCP
|
| 9 |
RUN git clone https://github.com/One-MCP/multi-mcp.git .
|
| 10 |
-
RUN uv venv
|
| 11 |
-
RUN . .venv/bin/activate && uv pip install -r requirements.txt
|
| 12 |
|
| 13 |
-
# Copy
|
| 14 |
-
COPY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
COPY tools/ /app/tools/
|
|
|
|
| 16 |
|
| 17 |
# Cache directories
|
| 18 |
RUN mkdir /app/.uv-cache && chmod -R 777 /app/.uv-cache
|
|
@@ -20,11 +36,10 @@ ENV UV_CACHE_DIR=/app/.uv-cache
|
|
| 20 |
RUN mkdir /app/.npm-cache && chmod -R 777 /app/.npm-cache
|
| 21 |
ENV npm_config_cache=/app/.npm-cache
|
| 22 |
|
| 23 |
-
# One-MCP
|
| 24 |
ENV CONFIG=/app/mcp.json
|
| 25 |
ENV TRANSPORT=sse
|
| 26 |
ENV USE_NAMESPACE=True
|
| 27 |
|
| 28 |
-
# Use One-MCP's port and command
|
| 29 |
EXPOSE 7860
|
| 30 |
CMD ["/app/.venv/bin/hypercorn", "src.main:app", "--bind", "0.0.0.0:7860"]
|
|
|
|
| 7 |
|
| 8 |
# Clone One-MCP
|
| 9 |
RUN git clone https://github.com/One-MCP/multi-mcp.git .
|
| 10 |
+
RUN uv venv && . .venv/bin/activate && uv pip install -r requirements.txt
|
|
|
|
| 11 |
|
| 12 |
+
# Copy requirements
|
| 13 |
+
COPY tools/requirements/ /tmp/requirements/
|
| 14 |
+
|
| 15 |
+
# Create shared venv for simple tools
|
| 16 |
+
RUN python3 -m venv /app/venvs/shared
|
| 17 |
+
RUN /app/venvs/shared/bin/pip install -r /tmp/requirements/shared.txt
|
| 18 |
+
|
| 19 |
+
# Create individual venvs for complex tools (skip shared.txt)
|
| 20 |
+
RUN for req in /tmp/requirements/*.txt; do \
|
| 21 |
+
name=$(basename "$req" .txt); \
|
| 22 |
+
if [ "$name" != "shared" ]; then \
|
| 23 |
+
echo "Creating venv for $name"; \
|
| 24 |
+
python3 -m venv "/app/venvs/$name"; \
|
| 25 |
+
"/app/venvs/$name/bin/pip" install -r "$req"; \
|
| 26 |
+
fi; \
|
| 27 |
+
done
|
| 28 |
+
|
| 29 |
+
# Copy tools and config
|
| 30 |
COPY tools/ /app/tools/
|
| 31 |
+
COPY mcp.json /app/mcp.json
|
| 32 |
|
| 33 |
# Cache directories
|
| 34 |
RUN mkdir /app/.uv-cache && chmod -R 777 /app/.uv-cache
|
|
|
|
| 36 |
RUN mkdir /app/.npm-cache && chmod -R 777 /app/.npm-cache
|
| 37 |
ENV npm_config_cache=/app/.npm-cache
|
| 38 |
|
| 39 |
+
# One-MCP settings
|
| 40 |
ENV CONFIG=/app/mcp.json
|
| 41 |
ENV TRANSPORT=sse
|
| 42 |
ENV USE_NAMESPACE=True
|
| 43 |
|
|
|
|
| 44 |
EXPOSE 7860
|
| 45 |
CMD ["/app/.venv/bin/hypercorn", "src.main:app", "--bind", "0.0.0.0:7860"]
|