diff --git a/.dockerignore b/.dockerignore index 9fa815b..7a007d2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,9 +1,11 @@ # Ignore certain directories .git/ -node_modules/ +.github/ +assets/ +**/bin/ +**/dist/ +**/node_modules/ # Ignore certain files -Dockerfile* -docker-compose* -compose* -README* +Dockerfile +README.md diff --git a/Dockerfile b/Dockerfile index 18f5556..554a2d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Frontend builder Image -FROM node:25-slim AS frontend-builder +FROM node:24-slim AS frontend-builder WORKDIR /app @@ -11,7 +11,7 @@ RUN corepack enable # Install dependencies COPY ./frontend/package.json . COPY ./frontend/pnpm-lock.yaml . -RUN pnpm install --prod --frozen-lockfile +RUN pnpm install --frozen-lockfile # Build COPY ./frontend . @@ -34,10 +34,13 @@ RUN go build -v -o ./bin/ . # Distribution Image FROM alpine:latest + RUN apk add --no-cache libc6-compat COPY --from=backend-builder /app/bin/twitchets /usr/bin/twitchets EXPOSE 9000 +WORKDIR /twitchets + ENTRYPOINT ["/usr/bin/twitchets"] diff --git a/README.md b/README.md index 4d94da7..680290a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Powered by [twigots](https://github.com/ahobsonsayers/twigots), a Go package to ### And a fancy configuration UI! -![frontend](assets/frontend.mp4) +https://github.com/user-attachments/assets/63e0fd3f-d767-4131-aae1-c18016008b20 ## Getting an API Key @@ -57,7 +57,7 @@ services: image: arranhs/twitchets:latest restart: unless-stopped volumes: - - :/twitchets + - :/twitchets/config.yaml ``` ## Configuration diff --git a/Taskfile.yaml b/Taskfile.yaml index a113ce1..0bdff37 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -67,10 +67,6 @@ tasks: cmds: - run build - build:docker: - cmds: - - docker build . -t arranhs/twitchets - run:be: cmds: - go run . @@ -80,11 +76,10 @@ tasks: cmds: - pnpm run dev - run:docker: - deps: [build:docker] + docker:build: + cmds: + - docker compose build + + docker:run: cmds: - - | - docker run --rm \ - --name twitchets \ - -p 5656:5656 \ - arranhs/twitchets + - docker compose up --build diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..0da97f1 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,12 @@ +services: + twitchets: + container_name: twitchets + image: arranhs/twitchets:latest + build: + dockerfile: Dockerfile + context: . + restart: unless-stopped + ports: + - 9000:9000 + volumes: + - ./config.yaml:/twitchets/config.yaml diff --git a/frontend/package.json b/frontend/package.json index bd5956a..db78478 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -4,9 +4,9 @@ "version": "1.0.0", "type": "module", "engines": { - "node": "^25" + "node": "^24" }, - "packageManager": "pnpm@10.13.1", + "packageManager": "pnpm@10.24.0", "scripts": { "dev": "vite", "build": "tsc -b && vite build",