FROM node:22.12-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy source code
COPY . .
# Build TypeScript code
RUN npm run build
# Set environment variables
ENV NODE_ENV=production
# Run the server
CMD ["node", "dist/index.js"]