-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.http
More file actions
74 lines (52 loc) · 1.77 KB
/
Copy pathDockerfile.http
File metadata and controls
74 lines (52 loc) · 1.77 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Dockerfile for Grouper MCP Server with MCPO HTTP proxy
# This image includes both the MCP server and MCPO, providing HTTP/SSE access
# Stage 1: Build the TypeScript application
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install all dependencies (including dev dependencies for build)
RUN npm ci
# Copy source code
COPY tsconfig.json ./
COPY src ./src
# Copy config directory (including properties file if it exists)
COPY config ./config
# Build TypeScript
RUN npm run build
# Stage 2: Production image with Node.js and Python
FROM node:20-alpine
WORKDIR /app
# Install Python and pip for MCPO
RUN apk add --no-cache python3 py3-pip
# Create non-root user
RUN addgroup -g 1001 -S mcp && \
adduser -u 1001 -S mcp -G mcp
# Copy package files
COPY package*.json ./
# Install only production dependencies
RUN npm ci --only=production && \
npm cache clean --force
# Copy built application from builder stage
COPY --from=builder /app/dist ./dist
# Copy config directory from builder
COPY --from=builder --chown=mcp:mcp /app/config ./config
# Create logs directory with proper permissions
RUN mkdir -p /home/mcp/.grouper-mcp/logs && \
chown -R mcp:mcp /home/mcp/.grouper-mcp
# Install MCPO
RUN pip3 install --no-cache-dir mcpo --break-system-packages
# Switch to non-root user
USER mcp
# Set default log directory
ENV GROUPER_LOG_DIR=/home/mcp/.grouper-mcp/logs
# Default MCPO port
ENV MCPO_PORT=8000
# Default MCPO host (0.0.0.0 to allow external connections)
ENV MCPO_HOST=0.0.0.0
# MCPO API key (should be overridden at runtime)
ENV MCPO_API_KEY=change-me-in-production
# Expose HTTP port for MCPO
EXPOSE 8000
# Start MCPO with the MCP server
CMD mcpo --host ${MCPO_HOST} --port ${MCPO_PORT} --api-key ${MCPO_API_KEY} -- node dist/index.js