# Use lightweight Node base image
FROM node:20-alpine

# Set working directory
WORKDIR /app

# Copy only package files first (better layer caching)
COPY . ./

# Install only production dependencies
RUN npm install --omit=dev


# Remove unnecessary dev/build artifacts (optional cleanup)
RUN rm -rf *.ts *.map tsconfig*.json

# Expose the port your WebSocket server uses
# (change if your app uses a different port)
EXPOSE 3000

# Run the app
CMD ["node", "main.js"]
