fix: improve Dockerfile with better git clone handling and build steps
Build and Push Docker Image / build (push) Successful in 57s
Build and Push Docker Image / build (push) Successful in 57s
This commit is contained in:
1 file changed
+10
-8
+10
-8
@@ -5,20 +5,22 @@ WORKDIR /app
|
||||
# Install build dependencies
|
||||
RUN apk add --no-cache git
|
||||
|
||||
# Clone and install dependencies
|
||||
RUN git clone https://github.com/brave/brave-search-mcp-server.git . && \
|
||||
npm ci --only=production && \
|
||||
npm run build
|
||||
# Clone repository into current directory
|
||||
RUN git clone https://github.com/brave/brave-search-mcp-server.git /tmp/brave-mcp && \
|
||||
cp -r /tmp/brave-mcp/* . && \
|
||||
rm -rf /tmp/brave-mcp
|
||||
|
||||
# Install dependencies and build
|
||||
RUN npm ci && npm run build
|
||||
|
||||
# Remove git since we don't need it in runtime
|
||||
RUN apk del git
|
||||
|
||||
# Remove dev dependencies and build artifacts we don't need
|
||||
RUN npm prune --production
|
||||
|
||||
# Expose the MCP server port
|
||||
EXPOSE 3000
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD node -e "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"
|
||||
|
||||
# Start the MCP server
|
||||
CMD ["npm", "start"]
|
||||
Reference in new issue
Block a user