# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use Node.js 18 as the base image
FROM node:18-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY src ./src
COPY tsconfig.json ./
# Build the application
RUN npx tsc
# Create the runtime image
FROM node:18-alpine
WORKDIR /app
# Copy built application from the builder stage
COPY --from=builder /app/build ./build
COPY package.json package-lock.json ./
# Install production dependencies
RUN npm install --production
# Copy .env file (or ensure it's mounted at runtime)
COPY .env ./
# Expose necessary ports (if any are known; adjust as needed)
EXPOSE 3000
# Define the default command
CMD ["node", "build/index.js"]