-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (28 loc) · 1.31 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (28 loc) · 1.31 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
# ── Build stage ────────────────────────────────────────────────────────────────
FROM node:24-slim AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts
COPY tsconfig.json ./
COPY src/ ./src/
RUN npm run build
# ── Production stage ──────────────────────────────────────────────────────────
FROM node:24-slim AS production
LABEL maintainer="Community"
LABEL description="Bitbucket MCP Server"
# Run as non-root user
RUN groupadd --gid 1001 mcp && \
useradd --uid 1001 --gid mcp --shell /bin/sh --create-home mcp
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev --ignore-scripts && npm cache clean --force
COPY --from=builder /app/build ./build
USER mcp
ENV NODE_ENV=production
ENV MCP_TRANSPORT=http
ENV MCP_PORT=3000
ENV MCP_HOST=0.0.0.0
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD ["node", "-e", "fetch('http://localhost:3000/health').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"]
ENTRYPOINT ["node", "build/index.js"]