# Use an official Node.js runtime as a parent image
FROM node:20-alpine
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json (if available)
# to install dependencies
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the TypeScript project
RUN npm run build
# The server communicates over stdio, so no port needs to be exposed.
# Command to run the application
CMD ["node", "build/index.js"]