FROM node:18-alpine
# Set the working directory inside the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application files
COPY . .
# Build the TypeScript code
RUN npm run build
# Prisma needs to generate the client
RUN npx prisma generate
# Run the bot using the built JavaScript file
CMD ["npm", "run", "start"]
FROM node:18-alpine
# Set the working directory inside the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application files
COPY . .
# Build the TypeScript code
RUN npm run build
# Prisma needs to generate the client
RUN npx prisma generate
# Run the bot using the built JavaScript file
CMD ["npm", "run", "start"]