From cb71ddbd54dd06e1ea52a7226d014ea866e1f2a9 Mon Sep 17 00:00:00 2001 From: Rohan Rustagi <110477025+RohanRusta21@users.noreply.github.com> Date: Mon, 27 Mar 2023 17:00:11 +0530 Subject: [PATCH 1/4] Added Dockerfile --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 859d27a..a8b869b 100644 --- a/README.md +++ b/README.md @@ -66,3 +66,19 @@ This section has moved here: https://facebook.github.io/create-react-app/docs/de ### `npm run build` fails to minify This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify + +### Build Docker Image of the Application + +```sh +docker build -t . +``` + +### Build Docker Image of the Application + +```sh +docker run -d -p 3000:3000 --name ,IMAGE_NAME> +``` + + +image + From e1fa79d78978da69b8731584a0f40105b6594185 Mon Sep 17 00:00:00 2001 From: Rohan Rustagi <110477025+RohanRusta21@users.noreply.github.com> Date: Mon, 27 Mar 2023 17:00:54 +0530 Subject: [PATCH 2/4] Updated README.md File --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a8b869b..7b95d9b 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ This section has moved here: https://facebook.github.io/create-react-app/docs/tr docker build -t . ``` -### Build Docker Image of the Application +### Execute Docker Image as a Container ```sh docker run -d -p 3000:3000 --name ,IMAGE_NAME> From d7093f89ecf23cf69566987332a0073b79471e65 Mon Sep 17 00:00:00 2001 From: Rohan Rustagi <110477025+RohanRusta21@users.noreply.github.com> Date: Mon, 27 Mar 2023 17:01:20 +0530 Subject: [PATCH 3/4] Updated README file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b95d9b..3ede848 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ docker build -t . ### Execute Docker Image as a Container ```sh -docker run -d -p 3000:3000 --name ,IMAGE_NAME> +docker run -d -p 3000:3000 --name ``` From e5c8e6da7e31c87ff0ea43e85c173e77c0adb451 Mon Sep 17 00:00:00 2001 From: Rohan Rustagi <110477025+RohanRusta21@users.noreply.github.com> Date: Mon, 27 Mar 2023 17:04:08 +0530 Subject: [PATCH 4/4] Added Dockerfile --- Dockerfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7f9ec26 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Dockerfile for React + +# Build react +FROM node:19 + +# Working directory be app +WORKDIR /usr/src/app + + +COPY package*.json ./ +COPY package-lock*.json ./ +### Installing dependencies + +RUN npm install + +# copy local files to app folder +COPY . . + +EXPOSE 3000 + +CMD ["npm","start"]