From 0b75a85ceabf4b491fd951febf4c0b11f9066985 Mon Sep 17 00:00:00 2001 From: Mohammad Reza Badri <85818966+mrbadri@users.noreply.github.com> Date: Sun, 21 Apr 2024 01:37:52 +0330 Subject: [PATCH] feat(root): dockerize project (#40) --- .dockerignore | 3 +++ Dockerfile | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2ad13cf --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +npm-debug.log +yarn-error.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..373f42a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# Use an official Node.js runtime as a parent image +FROM docker.arvancloud.ir/node:21-alpine3.18 + + +# Set the working directory in the container +WORKDIR /app + +# Copy package.json and package-lock.json (or yarn.lock) +COPY package.json ./ +COPY package-lock.json ./ + +# Install dependencies +RUN npm install --frozen-lockfile + +# Add the rest of the code +COPY . . + +# Build the project (specify the project name if needed) +RUN npx nx build docs --skip-nx-cache + + + +# Expose the port the app runs on +EXPOSE 4200 + +# Run the application +CMD ["npx", "nx", "serve", "docs"]