Skip to content

Commit 1e4350a

Browse files
committed
feat: Add Dockerfile for UniFi MCP server
- Node 20 alpine base image - Production-ready with health checks - Non-root user for security 🤖 Generated with Claude Code
1 parent e75695a commit 1e4350a

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# UniFi MCP Server Dockerfile
2+
FROM node:20-alpine
3+
4+
LABEL org.opencontainers.image.title="UniFi MCP Server"
5+
LABEL org.opencontainers.image.description="MCP server for UniFi Network management"
6+
LABEL org.opencontainers.image.source="https://github.com/ry-ops/unifi-mcp-server"
7+
LABEL org.opencontainers.image.vendor="ry-ops"
8+
9+
RUN apk add --no-cache ca-certificates curl
10+
11+
WORKDIR /app
12+
13+
COPY package*.json ./
14+
15+
RUN npm ci --only=production && npm cache clean --force
16+
17+
COPY . .
18+
19+
RUN addgroup -g 1001 -S unifi && \
20+
adduser -S -u 1001 -G unifi unifi && \
21+
chown -R unifi:unifi /app
22+
23+
USER unifi
24+
25+
ENV NODE_ENV=production
26+
ENV MCP_SERVER_TYPE=unifi
27+
28+
EXPOSE 3000
29+
30+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
31+
CMD node -e "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))" || exit 1
32+
33+
CMD ["node", "index.js"]

0 commit comments

Comments
 (0)