From 4a3840b4c9b4f7d7bd79ce735da321a7525aca25 Mon Sep 17 00:00:00 2001 From: 22107988t <22107988t@scm.univ-tours.fr> Date: Mon, 25 Sep 2023 13:40:22 +0200 Subject: [PATCH] Dockerfile nodejs --- app/Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 app/Dockerfile diff --git a/app/Dockerfile b/app/Dockerfile new file mode 100644 index 0000000..adc76dd --- /dev/null +++ b/app/Dockerfile @@ -0,0 +1,20 @@ +# pull the Node.js Docker image +FROM node:alpine + +# create the directory inside the container +WORKDIR /usr/src/app + +# copy the package.json files from local machine to the workdir in container +COPY package*.json ./ + +# run npm install in our local machine +RUN npm install + +# copy the generated modules and all other files to the container +COPY . . + +# our app is running on port 5000 within the container, so need to expose it +EXPOSE 5000 + +# the command that starts our app +CMD ["node", "index.js"]