FROM node:18-alpine

WORKDIR /usr/src/app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm install --only=production

# Copy app files
COPY . .

# Expose port
EXPOSE 3000

# Start the application
CMD ["node", "server.js"]