Skip to content

Commit 629e580

Browse files
authored
Update Dockerfile
1 parent d240c46 commit 629e580

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
FROM node:22-alpine
2+
23
ARG VERSION=latest
4+
5+
# Create mcp user and group
36
RUN addgroup -S mcp && adduser -S mcp -G mcp
7+
8+
# Install the MongoDB MCP server globally
49
RUN npm install -g mongodb-mcp-server@${VERSION}
10+
11+
# Install wget for health checks
12+
RUN apk add --no-cache wget
13+
14+
# Switch to mcp user
515
USER mcp
616
WORKDIR /home/mcp
17+
18+
# Expose port for Railway health checks
19+
EXPOSE 3000
20+
21+
# Add health check
22+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
23+
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
24+
25+
# Set the entrypoint
726
ENTRYPOINT ["mongodb-mcp-server"]
27+
28+
# Labels
829
LABEL maintainer="MongoDB Inc <[email protected]>"
930
LABEL description="MongoDB MCP Server"
1031
LABEL version=${VERSION}

0 commit comments

Comments
 (0)