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"] diff --git a/README.md b/README.md index 859d27a..3ede848 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 . +``` + +### Execute Docker Image as a Container + +```sh +docker run -d -p 3000:3000 --name +``` + + +image +