From 629e580c77189bb375fee7c5c8da49244cc4076e Mon Sep 17 00:00:00 2001 From: yairsabag <109817835+yairsabag@users.noreply.github.com> Date: Wed, 4 Jun 2025 11:37:45 +0300 Subject: [PATCH] Update Dockerfile --- Dockerfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Dockerfile b/Dockerfile index 05da379f..ad3bdfe3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 " LABEL description="MongoDB MCP Server" LABEL version=${VERSION}