# Use an official Node runtime
FROM node:20-alpine

# Create app directory
WORKDIR /usr/src/app

# Install dependencies
COPY package.json .
RUN npm install --only=production

# Copy app source
COPY . .

# Expose the port that the app listens on
EXPOSE 3000

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