-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (32 loc) · 1.62 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (32 loc) · 1.62 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
# ── Build stage ───────────────────────────────────────────────────────────────
FROM node:24-slim AS builder
WORKDIR /app
RUN npm install -g pnpm@9.15.0 --ignore-scripts
# Install dependencies (layer cached unless lock changes)
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Build TypeScript
COPY tsconfig.json tsconfig.build.json ./
COPY src/ src/
RUN pnpm build
# Remove dev dependencies
RUN pnpm prune --prod
# ── Production stage ──────────────────────────────────────────────────────────
FROM node:24-slim AS production
LABEL org.opencontainers.image.title="email-mcp" \
org.opencontainers.image.description="IMAP/SMTP email MCP server — 47 tools, IMAP IDLE push, multi-account, AI triage" \
org.opencontainers.image.url="https://github.com/codefuturist/email-mcp" \
org.opencontainers.image.source="https://github.com/codefuturist/email-mcp" \
org.opencontainers.image.licenses="LGPL-3.0-or-later" \
org.opencontainers.image.vendor="codefuturist"
WORKDIR /app
# Copy only production artifacts
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./
# Create config directory for volume mount
RUN mkdir -p /home/node/.config/email-mcp && chown -R node:node /home/node/.config
ENV NODE_ENV=production
USER node
ENTRYPOINT ["node", "dist/main.js"]
CMD ["stdio"]