Skip to content

Commit 77973a3

Browse files
committed
Add running using docker-compose
1 parent 11ea7d7 commit 77973a3

5 files changed

Lines changed: 106 additions & 0 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'worker.js'
8+
- 'wrangler.jsonc'
9+
- 'entrypoint.sh'
10+
- 'Dockerfile'
11+
- 'templates/**'
12+
pull_request:
13+
branches: [ main ]
14+
paths:
15+
- 'worker.js'
16+
- 'wrangler.jsonc'
17+
- 'entrypoint.sh'
18+
- 'Dockerfile'
19+
- 'templates/**'
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: Login to DockerHub
35+
uses: docker/login-action@v3
36+
with:
37+
username: ${{ secrets.DOCKERHUB_USERNAME }}
38+
password: ${{ secrets.DOCKERHUB_TOKEN }}
39+
40+
- name: Get latest Git tag
41+
id: git_tag
42+
run: |
43+
git fetch --tags
44+
latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "dev")
45+
echo "LATEST_TAG=$latest_tag" >> $GITHUB_OUTPUT
46+
47+
- name: Build and push Docker image (multi-platform)
48+
uses: docker/build-push-action@v5
49+
with:
50+
context: .
51+
push: ${{ github.event_name != 'pull_request' }}
52+
tags: |
53+
${{ secrets.DOCKERHUB_USERNAME }}/seerr-notifier:${{ steps.git_tag.outputs.LATEST_TAG }}
54+
${{ secrets.DOCKERHUB_USERNAME }}/seerr-notifier:latest
55+
platforms: linux/amd64,linux/arm64

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:20-bookworm
2+
3+
WORKDIR /app
4+
5+
RUN npm install -g wrangler
6+
7+
COPY worker.js .
8+
9+
COPY wrangler.jsonc ./default-config/wrangler.jsonc
10+
COPY templates ./default-templates
11+
12+
COPY entrypoint.sh ./entrypoint.sh
13+
RUN chmod +x entrypoint.sh
14+
15+
EXPOSE 8787
16+
17+
ENTRYPOINT ["./entrypoint.sh"]

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
**❓ How to use it?**
3333
* [**Using Cloudflare Workers**](#%EF%B8%8F-using-cloudflare-workers-to-run-seerr-notifier)
34+
* [**Using docker-compose**](#-using-docker-compose-to-run-seerr-notifier)
3435

3536
**❓ What did I use?**
3637
* JavaScript
@@ -49,6 +50,12 @@
4950
6) Enable `Request Available` in `Notification Types`
5051
7) Save
5152

53+
## 🐳 Using docker-compose to run Seerr Notifier
54+
1) Copy `docker-compose.yml`
55+
2) Run container - `docker-compose up -d`
56+
3) Edit `config/wrangler.jsonc` according to [Environment variables](#%EF%B8%8F-environment-variables)
57+
4) Restart container
58+
5259
## 🛠️ Environment variables
5360
* `SECRET_TOKEN` - random strong string
5461
* `LANG` - language of sent notications (choose one from templates or [create your own](#-creating-your-own-template))

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3.9'
2+
services:
3+
seerr-notifier:
4+
image: seerr-notifier:latest
5+
container_name: seerr-notifier
6+
ports:
7+
- "8787:8787" # <Host Port>:<Container Port (do not change)>
8+
volumes:
9+
- ./config:/app/config
10+
- ./templates:/app/templates
11+
tty: true
12+
stdin_open: true
13+
restart: unless-stopped

entrypoint.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
mkdir -p /app/config
4+
mkdir -p /app/templates
5+
6+
if [ ! -f /app/config/wrangler.jsonc ]; then
7+
cp /app/default-config/wrangler.jsonc /app/config/wrangler.jsonc
8+
fi
9+
10+
if [ -z "$(ls -A /app/templates)" ]; then
11+
cp -r /app/default-templates/* /app/templates/
12+
fi
13+
14+
exec wrangler dev /app/worker.js --local --host 0.0.0.0 --assets /app/templates

0 commit comments

Comments
 (0)