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