Elasticsearch MCP Server
by cr7258
# Use the official Node.js 16 image as the base image
FROM node:16-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy the package.json and package-lock.json files
COPY package.json package-lock.json ./
# Install the dependencies
RUN npm install
# Copy the rest of the application source code
COPY . .
# Build the application
RUN npm run build
# Use a lighter base image for the runtime
FROM node:16-alpine AS release
# Set the working directory
WORKDIR /app
# Copy only the necessary files from the builder stage
COPY --from=builder /app/build /app/build
COPY --from=builder /app/node_modules /app/node_modules
COPY --from=builder /app/package.json /app/package.json
# Set environment variables
ENV NODE_ENV=production
# Define the command to run the application
ENTRYPOINT ["node", "build/index.js"]