# ===========================
# 1. Use official Node.js image
# ===========================
FROM node:20-alpine

# Create and set working directory
WORKDIR /usr/src/app

# Copy only package files first (for better caching)
COPY package*.json ./

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

# Copy all project files to the container
COPY . .

# Expose the port your app runs on
EXPOSE 3000

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