Merge pull request #88 from jlawrence11/main

Docker added.
This commit is contained in:
MathMan05 2025-03-10 11:46:07 -05:00 committed by GitHub
commit 13cd920ad2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 49 additions and 9 deletions

18
.github/workflows/docker-image.yml vendored Normal file
View file

@ -0,0 +1,18 @@
name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)

18
Dockerfile Normal file
View file

@ -0,0 +1,18 @@
FROM node:18-bullseye AS builder
WORKDIR /devel
RUN apt-get update ; apt-get upgrade -y ; apt-get install -y build-essential
COPY . .
RUN npm i ; npm run build
FROM node:18-alpine
EXPOSE 8080
WORKDIR /exec
RUN apk add --update nodejs npm
COPY --from=builder /devel/ .
RUN adduser -D jankclient
USER jankclient
CMD ["npm", "start"]

View file

@ -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.

8
compose.yaml Normal file
View file

@ -0,0 +1,8 @@
services:
jank:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "8080:8080"

View file

@ -290,12 +290,8 @@ class Member extends SnowFlake {
hypomember.bio = _;
regen();
});
return; //Returns early to stop errors
if (this.accent_color) {
color = "#" + this.accent_color.toString(16);
} else {
color = "transparent";
}
color = (this.accent_color ? "#" + this.accent_color.toString(16) : "transparent") as string;
const colorPicker = settingsLeft.addColorInput(
I18n.getTranslation("profileColor"),
(_) => {},
@ -304,7 +300,7 @@ class Member extends SnowFlake {
colorPicker.watchForChange((_) => {
console.log();
color = _;
hypomember.accent_color = Number.parseInt("0x" + _.substr(1), 16);
hypomember.accent_color = Number.parseInt("0x" + _.substr(1, 16));
changed = true;
regen();
});