Files
LocalAGI/Dockerfile.mcpbox
alex 6c6f6fe35a Correction de la migration MCP - Utilisation correcte des transports
- Ajout de l'import client/transport pour accéder aux transports
- Correction de initMCPActions pour utiliser NewStreamableHTTP avec support des headers d'autorisation
- Correction de la partie STDIO pour utiliser NewStdio avec transport.NewStdio()
- Ajout de l'appel Start() sur les clients avant utilisation (requis par la nouvelle API)
- Correction des types: utilisation de *client.Client au lieu de client.MCPClient
- La migration corrige l'erreur 'transport not started yet' observée dans les logs
2025-06-13 22:42:59 +02:00

83 lines
1.4 KiB
Docker

# Build stage
FROM golang:1.24-alpine AS builder
# Install build dependencies
RUN apk add --no-cache git
# Set working directory
WORKDIR /app
# Copy go mod files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy source code
COPY . .
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -o mcpbox ./cmd/mcpbox
# Final stage
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
tzdata \
docker.io \
bash \
wget \
curl \
jq \
python3 \
unzip \
python3-pip \
python3-venv \
pipx \
nodejs \
npm \
netcat-openbsd \
dnsutils \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /app/data/.npm
RUN mkdir -p /app/data/.cache
RUN mkdir -p /app/data/.local
ENV NPM_CONFIG_CACHE=/app/data/.npm
ENV UV_CACHE_DIR=/app/data/.cache/uv
# Install uv
ADD https://astral.sh/uv/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && rm /uv-installer.sh
RUN ln -sf /root/.local/bin/uv /usr/local/bin/uv
RUN npm install -g bun
RUN uv tool install git+https://github.com/sparfenyuk/mcp-proxy
# Create non-root user
#RUN adduser -D -g '' appuser
# Set working directory
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/mcpbox .
# Use non-root user
#USER appuser
# Expose port
EXPOSE 8080
# Set entrypoint
ENTRYPOINT ["/app/mcpbox"]
# Default command
CMD ["-addr", ":8080"]