From dafc1eadff47e7838c4275363b6f7f027a160bd1 Mon Sep 17 00:00:00 2001 From: Jon Lawrence Date: Mon, 3 Mar 2025 14:52:37 -0800 Subject: [PATCH] Added docker Added a Dockerfile and compose.yaml for easy deployment via docker. Updated README to provide clear instruction on how to get the instance running. --- Dockerfile-jank | 18 ++++++++++++++++++ README.md | 4 ++-- compose.yaml | 8 ++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 Dockerfile-jank create mode 100644 compose.yaml diff --git a/Dockerfile-jank b/Dockerfile-jank new file mode 100644 index 0000000..a004369 --- /dev/null +++ b/Dockerfile-jank @@ -0,0 +1,18 @@ +From node:18-bullseye as builder + +WORKDIR devel/ +RUN apt-get update ; apt-get upgrade -y ; apt-get install -y python-is-python3 build-essential git +RUN git clone https://github.com/MathMan05/JankClient +RUN cd JankClient ; npm i ; npm run build + +From node:18-alpine + +EXPOSE 8080 +WORKDIR exec +RUN apk add --update git nodejs npm +COPY --from=builder /devel/JankClient/ . +RUN adduser -D jankclient + +USER jankclient + +CMD ["npm", "start"] diff --git a/README.md b/README.md index af4289e..365441c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Jank Client Jank Client is a [Spacebar](https://spacebar.chat) Client written in TS, HTML, and CSS. -To run it, clone the repo and do `npm install`, then -`node index.js` +To build it, clone the repo and run `npm install`, then `npm run build` +To run it, use `npm start` or do the equivalent with bun Both [Bun](https://bun.sh) and [Node.js](https://nodejs.org) are supported, and should function as expected. diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..f93d94a --- /dev/null +++ b/compose.yaml @@ -0,0 +1,8 @@ +services: + jank: + build: + context: . + dockerfile: Dockerfile-jank + restart: unless-stopped + ports: + - "8080:8080"