-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (39 loc) · 1.36 KB
/
Dockerfile
File metadata and controls
55 lines (39 loc) · 1.36 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
# Stage 1: Builder
FROM node:20-alpine AS builder
# Install build dependencies for native modules
RUN apk add --no-cache python3 make g++
WORKDIR /app
COPY package.json package-lock.json ./
# Install dependencies (including devDependencies for build)
RUN npm ci
# Copy source code and config
COPY . .
# Install MCP servers (adding to dependencies so they survive prune)
RUN npm install @modelcontextprotocol/server-filesystem @modelcontextprotocol/server-git
# Build TypeScript
RUN npm run build
# Remove devDependencies
RUN npm prune --production
# Stage 2: Runner
FROM node:20-alpine AS runner
WORKDIR /app
# Install runtime dependencies (if any)
# better-sqlite3 binaries are copied from builder
RUN apk add --no-cache libstdc++
# Copy artifacts from builder
COPY --from=builder /app/package.json /app/package-lock.json ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/bin ./bin
COPY --from=builder /app/entrypoint.sh ./entrypoint.sh
COPY --from=builder /app/mcp.docker.json ./mcp.docker.json
COPY --from=builder /app/persona.json ./persona.json
COPY --from=builder /app/docs ./docs
COPY --from=builder /app/sops ./sops
COPY --from=builder /app/templates ./templates
# Ensure entrypoint is executable
RUN chmod +x entrypoint.sh
ENV NODE_ENV=production
ENV PORT=3002
EXPOSE 3002
ENTRYPOINT ["./entrypoint.sh"]