From 3301b365f9913f32cebc60755e5cc477822743ac Mon Sep 17 00:00:00 2001 From: M1000fr Date: Mon, 2 Dec 2024 14:37:58 +0100 Subject: [PATCH] feat: Add Docker configuration files Add .dockerignore, Dockerfile, and docker-compose.yml files to configure Docker for the project. --- .dockerignore | 5 +++++ Dockerfile | 26 ++++++++++++++++++++++++++ docker-compose.yml | 5 +++++ 3 files changed, 36 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4089434 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +dist +*.log +*.md +.git \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c91b825 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +# Use the official Node.js image as the base image +FROM node:20 + +# 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"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d960e4d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,5 @@ +services: + api: + image: toogether/api + ports: + - "3000:3000" \ No newline at end of file