-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (45 loc) · 1.74 KB
/
Dockerfile
File metadata and controls
66 lines (45 loc) · 1.74 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
FROM node:22-alpine AS builder
WORKDIR /app
# Copy package files
COPY package.json ./
COPY pnpm-lock.yaml ./
COPY pnpm-workspace.yaml ./
COPY tsconfig.json ./
# Copy source code
COPY index.ts ./
COPY utils/ ./utils/
COPY tools/ ./tools/
RUN addgroup -g 1001 -S hackmd-mcp && \
adduser -S hackmd-mcp -u 1001 -G hackmd-mcp
RUN corepack enable pnpm && corepack install
# Install all dependencies (including dev deps for TypeScript compilation)
RUN pnpm install --frozen-lockfile
# Build TypeScript code
RUN pnpm run build
FROM node:22-alpine AS release
LABEL org.opencontainers.image.title="HackMD MCP"
LABEL org.opencontainers.image.description="A Model Context Protocol server for integrating HackMD's note-taking platform with AI assistants."
LABEL org.opencontainers.image.version="1.5.7"
LABEL org.opencontainers.image.vendor="yuna0x0"
LABEL org.opencontainers.image.authors="yuna0x0 <yuna@yuna0x0.com>"
LABEL org.opencontainers.image.url="https://github.com/yuna0x0/hackmd-mcp"
LABEL org.opencontainers.image.source="https://github.com/yuna0x0/hackmd-mcp"
LABEL org.opencontainers.image.licenses="MIT"
LABEL io.modelcontextprotocol.server.name="io.github.yuna0x0/hackmd-mcp"
RUN addgroup -g 1001 -S hackmd-mcp && \
adduser -S hackmd-mcp -u 1001 -G hackmd-mcp
WORKDIR /app
# Copy package files and built code
COPY --from=builder /app/package.json ./
COPY --from=builder /app/pnpm-lock.yaml ./
COPY --from=builder /app/dist/ ./dist/
RUN chown -R hackmd-mcp:hackmd-mcp /app
ENV NODE_ENV=production
ENV TRANSPORT=http
RUN corepack enable pnpm && corepack install
# Install only production dependencies
RUN pnpm install --frozen-lockfile --prod --ignore-scripts
USER hackmd-mcp
# Expose port for HTTP transport
EXPOSE 8081
CMD ["node", "dist/index.js"]