Skip to content

Update Dockerfile #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
FROM node:22-alpine

ARG VERSION=latest

# Create mcp user and group
RUN addgroup -S mcp && adduser -S mcp -G mcp

# Install the MongoDB MCP server globally
RUN npm install -g mongodb-mcp-server@${VERSION}

# Install wget for health checks
RUN apk add --no-cache wget

# Switch to mcp user
USER mcp
WORKDIR /home/mcp

# Expose port for Railway health checks
EXPOSE 3000

# Add health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1

# Set the entrypoint
ENTRYPOINT ["mongodb-mcp-server"]

# Labels
LABEL maintainer="MongoDB Inc <[email protected]>"
LABEL description="MongoDB MCP Server"
LABEL version=${VERSION}
Loading