# Use the official Node.js image as a base
FROM node:22

# Set the working directory inside the container
WORKDIR /app

# Copy package.json and package-lock.json (or yarn.lock) into the container
COPY package*.json ./

# Install dependencies inside the container
RUN npm install

# Copy the rest of the application code
COPY . .

# Generate Prisma client
RUN npm run prisma:generate


# Build the NestJS application
RUN npm run build

# Expose the port the app will run on
EXPOSE 3005 8005

# Define the command to run the application
CMD ["npm", "run", "start"]
