From c0394c613572371d8010816a5bdc0437e0d2f234 Mon Sep 17 00:00:00 2001 From: Ernie Massei Date: Thu, 28 Oct 2021 11:03:30 -0500 Subject: [PATCH] add dockerfile --- Dockerfile | 19 +++++++++++++++++++ README.md | 20 ++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..da94c93 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# pull official base image +FROM node:13.12.0-alpine + +# set working directory +WORKDIR /app + +# add `/app/node_modules/.bin` to $PATH +ENV PATH /app/node_modules/.bin:$PATH + +# install app dependencies +COPY package.json ./ +COPY package-lock.json ./ +RUN npm install --silent + +# add app +COPY . ./ + +# start app +CMD ["npm", "run", "start"] diff --git a/README.md b/README.md index d6c8fa6..0505636 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,26 @@ Contributions are welcome! Please create an issue before contributing to this project. Features should be worked on in separate branches and pull requests should be made for every proposed change. +## Docker +To run locally build the image, from root directory +``` +docker build -t salad . +``` + +Run the container +``` +docker run \ + -it \ + --rm \ + -v ${PWD}:/app \ + -v /app/node_modules \ + -p 3001:3000 \ + -e CHOKIDAR_USEPOLLING=true \ + salad +``` + +Navigate to the url provided + ## About Built and maintained by Michael Lu