# Use Node.js 18 as base image
FROM node:18
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy source code
COPY . .
# Build the project
RUN npm run build
# Command to run the server
CMD ["node", "dist/index.js"]