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

# Update package manager and install security updates
RUN apk update && apk upgrade

# Set working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Expose the port (change if your app uses a different port)
EXPOSE 5000

# Start the app
CMD