# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Start from the official Node.js image with the desired version
FROM node:18-alpine AS builder
# Set the working directory inside the Docker image
WORKDIR /app
# Copy the package.json and package-lock.json to the working directory
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the source code to the working directory
COPY ./src ./src
COPY tsconfig.json ./
# Run the build command to compile TypeScript to JavaScript
RUN npm run build
# Now create the production image, based on a smaller image
FROM node:18-alpine
# Set the working directory inside the Docker image
WORKDIR /app
# Copy the compiled JavaScript files from the builder stage
COPY --from=builder /app/build /app/build
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/package-lock.json /app/package-lock.json
# Install only production dependencies
RUN npm ci --omit=dev
# Set environment variable for Shodan API Key
ENV SHODAN_API_KEY=your-shodan-api-key
# Command to run the MCP server
ENTRYPOINT ["node", "build/index.js"]