2024-12-02 13:37:58 +00:00
|
|
|
# Use the official Node.js image as the base image
|
2024-12-10 13:41:30 +00:00
|
|
|
FROM node:20
|
2024-12-02 13:37:58 +00:00
|
|
|
|
|
|
|
# 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 ./
|
|
|
|
|
|
|
|
# Install the application dependencies
|
|
|
|
RUN yarn install
|
|
|
|
|
|
|
|
# Copy the rest of the application files
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Generate Prisma client
|
|
|
|
RUN yarn prisma generate
|
|
|
|
|
|
|
|
# Build the NestJS application
|
|
|
|
RUN yarn build
|
|
|
|
|
|
|
|
# Expose the application port
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
# Command to run the application
|
|
|
|
CMD ["node", "dist/main"]
|