Skip to content

Created a Dockerfile for hypertext-editor #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
LICENSE*
README.md
Dockerfile
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
<https://googlechromelabs.github.io/text-editor/>.


## 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 <image_name> .

docker run -d -it --name <container_name> -p <forward_portnumber>:<application_port_number> <image_name>

```