# Use an official Node.js runtime as a base image
FROM node:16

# Set the working directory inside the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json (if available)
COPY package*.json ./

# Install pm2 globally
RUN npm install -g pm2

# Install Node.js dependencies
RUN npm install

# Copy the rest of the application code to the container
COPY . .

# Expose the port your app runs on (assuming it's 3000)
EXPOSE 2070

# Command to run your application
CMD ["pm2-runtime", "start", "server.js", "--node-args='--experimental-specifier-resolution=node'"]
