diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2a53bce --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +LICENSE* +README.md +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..12190af --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM node:16.15.0-alpine + +WORKDIR /opt/app-root/src + +COPY . . + +ENV USER_NAME=hyper \ + USER_ID=1001 \ + GROUP_ID=0 + +RUN echo "${USER_NAME}:x:${USER_ID}:${GROUP_ID}:Hypertext Application User:/opt/app-root/:/bin/bash" >> /etc/passwd &\ + chown -R 1001:0 "/opt/app-root" + +USER 1001 + +RUN npm install + +EXPOSE 8080 + +CMD ["npm", "start"] \ No newline at end of file diff --git a/README.md b/README.md index a498cc4..1827547 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,30 @@ in showing me how some of the wonky bits worked. Also thanks to the Google dev relations guys for the file stuff here: . + +## How to run this app + +``` +git clone https://github.com/russellbeattie/hypertext-editor.git + +cd hypertext-editor + +npm install + +npm start + +``` + +## How to run this app using Docker + + +``` +git clone https://github.com/russellbeattie/hypertext-editor.git + +cd hypertext-editor + +docker build -t . + +docker run -d -it --name -p : + +```