From 8572baecd0e1119538a65dffc03037ea78be9e5e Mon Sep 17 00:00:00 2001 From: yassine naanani <27584700+K11E3R@users.noreply.github.com> Date: Mon, 8 Jul 2024 17:32:42 +0200 Subject: [PATCH 1/2] Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tested via git - codespace ✅ 0 error ✅ --- Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000..be39ef51e3968 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:14 + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +EXPOSE 80 + +CMD ["npm", "start"] From 146a84053c095292c599ca69f621844c71304957 Mon Sep 17 00:00:00 2001 From: yassine naanani <27584700+K11E3R@users.noreply.github.com> Date: Mon, 8 Jul 2024 17:39:54 +0200 Subject: [PATCH 2/2] Dockerfile Enhanced with comments --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index be39ef51e3968..2fc343b9c9600 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,20 @@ +# Use Node.js version 14 as the base image FROM node:14 +# Set the working directory inside the container WORKDIR /app +# Copy package.json and package-lock.json (if present) to the working directory COPY package*.json ./ +# Install npm dependencies RUN npm install +# Copy all files from the current directory to the working directory in the container COPY . . +# Expose port 80 to allow communication to/from the container EXPOSE 80 +# Specify the command to run the application CMD ["npm", "start"]