Add jellyfin-ha container build
Build-orchestration for the jellyfin-ha Jellyfin fork: pins an upstream
commit (UPSTREAM_REF), publishes the .NET 10 server, and builds/pushes the
runtime image to git.unkin.net/unkin/jellyfin-ha on v* tags.
- UPSTREAM_REF pinned to d4f9c12
- Dockerfile.runtime (vendored runtime-only image + jellyfin-web 10.11.6)
- .woodpecker/{build,docker}.yaml (publish + docker-buildx, k8s resources)
- Makefile (publish/build + patch/minor/major release tagging)
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# Keep the docker build context small: only publish-output + Dockerfile.runtime
|
||||
# are needed. The upstream source clone lives under src/ and must not be sent.
|
||||
src/
|
||||
.git/
|
||||
.woodpecker/
|
||||
*.md
|
||||
Makefile
|
||||
@@ -0,0 +1,2 @@
|
||||
/src/
|
||||
/publish-output/
|
||||
@@ -0,0 +1,44 @@
|
||||
when:
|
||||
- event: pull_request
|
||||
|
||||
steps:
|
||||
# Clone the pinned upstream jellyfin-ha source and publish the .NET server
|
||||
# into ./publish-output (consumed by Dockerfile.runtime).
|
||||
- name: publish
|
||||
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||
commands:
|
||||
- |
|
||||
REF=$$(cat UPSTREAM_REF)
|
||||
git clone https://github.com/ZoltyMat/jellyfin-ha.git src
|
||||
git -C src checkout "$$REF"
|
||||
dotnet publish src/Jellyfin.Server/Jellyfin.Server.csproj \
|
||||
-c Release -r linux-x64 --self-contained false -o ./publish-output
|
||||
backend_options:
|
||||
kubernetes:
|
||||
serviceAccountName: default
|
||||
resources:
|
||||
requests:
|
||||
memory: 2Gi
|
||||
cpu: 2
|
||||
limits:
|
||||
memory: 6Gi
|
||||
cpu: 4
|
||||
|
||||
# Validate the runtime image builds (no push on PRs).
|
||||
- name: docker-build
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
repo: git.unkin.net/unkin/jellyfin-ha
|
||||
dockerfile: Dockerfile.runtime
|
||||
dry_run: true
|
||||
depends_on: [publish]
|
||||
backend_options:
|
||||
kubernetes:
|
||||
serviceAccountName: default
|
||||
resources:
|
||||
requests:
|
||||
memory: 1Gi
|
||||
cpu: 1
|
||||
limits:
|
||||
memory: 4Gi
|
||||
cpu: 2
|
||||
@@ -0,0 +1,50 @@
|
||||
when:
|
||||
- event: tag
|
||||
ref: refs/tags/v*
|
||||
|
||||
steps:
|
||||
# Same publish step as the PR pipeline: clone pinned upstream + dotnet publish.
|
||||
- name: publish
|
||||
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||
commands:
|
||||
- |
|
||||
REF=$$(cat UPSTREAM_REF)
|
||||
git clone https://github.com/ZoltyMat/jellyfin-ha.git src
|
||||
git -C src checkout "$$REF"
|
||||
dotnet publish src/Jellyfin.Server/Jellyfin.Server.csproj \
|
||||
-c Release -r linux-x64 --self-contained false -o ./publish-output
|
||||
backend_options:
|
||||
kubernetes:
|
||||
serviceAccountName: default
|
||||
resources:
|
||||
requests:
|
||||
memory: 2Gi
|
||||
cpu: 2
|
||||
limits:
|
||||
memory: 6Gi
|
||||
cpu: 4
|
||||
|
||||
# Build the runtime image and push it to the Gitea registry.
|
||||
- name: docker
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
registry: git.unkin.net
|
||||
repo: git.unkin.net/unkin/jellyfin-ha
|
||||
dockerfile: Dockerfile.runtime
|
||||
username: droneci
|
||||
password:
|
||||
from_secret: DRONECI_PASSWORD
|
||||
tags:
|
||||
- ${CI_COMMIT_TAG}
|
||||
- latest
|
||||
depends_on: [publish]
|
||||
backend_options:
|
||||
kubernetes:
|
||||
serviceAccountName: default
|
||||
resources:
|
||||
requests:
|
||||
memory: 1Gi
|
||||
cpu: 1
|
||||
limits:
|
||||
memory: 4Gi
|
||||
cpu: 2
|
||||
@@ -0,0 +1,57 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
# Runtime-only image for the jellyfin-ha fork.
|
||||
#
|
||||
# The .NET publish step runs on the CI host (see .woodpecker/*.yaml) and drops
|
||||
# its output into ./publish-output, which is COPYed in below. This file is a
|
||||
# vendored copy of upstream's Dockerfile.runtime so we control the pinned
|
||||
# jellyfin-web version and base image; bump alongside UPSTREAM_REF.
|
||||
|
||||
# ── Web client stage ──────────────────────────────────────────────────────────
|
||||
# Install jellyfin-web via the official Jellyfin apt repo (prebuilt, no npm).
|
||||
# Web assets land at /usr/share/jellyfin/web/.
|
||||
FROM --platform=linux/amd64 debian:bookworm-slim AS webclient
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends curl gnupg ca-certificates \
|
||||
&& curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key \
|
||||
| gpg --dearmor -o /usr/share/keyrings/jellyfin.gpg \
|
||||
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/jellyfin.gpg] https://repo.jellyfin.org/debian bookworm main" \
|
||||
> /etc/apt/sources.list.d/jellyfin.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends "jellyfin-web=10.11.6+deb12" \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# ── Runtime stage ─────────────────────────────────────────────────────────────
|
||||
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/aspnet:10.0
|
||||
|
||||
# FFmpeg and the native deps required by SkiaSharp and fontconfig.
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
ffmpeg \
|
||||
fontconfig \
|
||||
libfontconfig1 \
|
||||
libfreetype6 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /jellyfin
|
||||
|
||||
# Pre-built publish output produced by `dotnet publish` on the CI host.
|
||||
COPY publish-output/ .
|
||||
# jellyfin-web client assets from the webclient stage.
|
||||
COPY --from=webclient /usr/share/jellyfin/web ./jellyfin-web/
|
||||
|
||||
# Jellyfin default ports
|
||||
EXPOSE 8096
|
||||
EXPOSE 8920
|
||||
|
||||
# Data / config volumes
|
||||
VOLUME ["/config", "/cache", "/media"]
|
||||
|
||||
ENV JELLYFIN_DATA_DIR=/config \
|
||||
JELLYFIN_CACHE_DIR=/cache \
|
||||
JELLYFIN_LOG_DIR=/config/log
|
||||
|
||||
ENTRYPOINT ["./jellyfin", \
|
||||
"--datadir", "/config", \
|
||||
"--cachedir", "/cache", \
|
||||
"--webdir", "/jellyfin/jellyfin-web"]
|
||||
@@ -0,0 +1,39 @@
|
||||
.PHONY: publish build clean patch minor major
|
||||
|
||||
IMAGE ?= git.unkin.net/unkin/jellyfin-ha
|
||||
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "0.0.0-dev")
|
||||
REF := $(shell cat UPSTREAM_REF)
|
||||
|
||||
# Clone the pinned upstream source and publish the .NET server into
|
||||
# ./publish-output (consumed by Dockerfile.runtime). Mirrors CI.
|
||||
publish:
|
||||
rm -rf src publish-output
|
||||
git clone https://github.com/ZoltyMat/jellyfin-ha.git src
|
||||
git -C src checkout $(REF)
|
||||
dotnet publish src/Jellyfin.Server/Jellyfin.Server.csproj \
|
||||
-c Release -r linux-x64 --self-contained false -o ./publish-output
|
||||
|
||||
build: publish
|
||||
docker build -f Dockerfile.runtime -t $(IMAGE):$(VERSION) .
|
||||
|
||||
clean:
|
||||
rm -rf src publish-output
|
||||
docker rmi $(IMAGE):$(VERSION) 2>/dev/null || true
|
||||
|
||||
_LATEST := $(shell git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$$' | head -1)
|
||||
_BASE := $(if $(_LATEST),$(_LATEST),v0.0.0)
|
||||
_MAJ := $(shell echo $(_BASE) | sed 's/^v//' | cut -d. -f1)
|
||||
_MIN := $(shell echo $(_BASE) | sed 's/^v//' | cut -d. -f2)
|
||||
_PAT := $(shell echo $(_BASE) | sed 's/^v//' | cut -d. -f3)
|
||||
|
||||
patch:
|
||||
@NEW=v$(_MAJ).$(_MIN).$(shell expr $(_PAT) + 1); \
|
||||
git tag $$NEW && echo "Tagged $$NEW" && git push origin $$NEW
|
||||
|
||||
minor:
|
||||
@NEW=v$(_MAJ).$(shell expr $(_MIN) + 1).0; \
|
||||
git tag $$NEW && echo "Tagged $$NEW" && git push origin $$NEW
|
||||
|
||||
major:
|
||||
@NEW=v$(shell expr $(_MAJ) + 1).0.0; \
|
||||
git tag $$NEW && echo "Tagged $$NEW" && git push origin $$NEW
|
||||
@@ -1,3 +1,41 @@
|
||||
# jellyfin-ha
|
||||
# jellyfin-ha (container build)
|
||||
|
||||
Container build for the jellyfin-ha (HA transcoding) Jellyfin fork
|
||||
Build-orchestration repo for [ZoltyMat/jellyfin-ha](https://github.com/ZoltyMat/jellyfin-ha) — a Jellyfin fork
|
||||
that adds distributed, Redis-backed transcoding for multi-pod Kubernetes (lease-aware cleanup, HA session
|
||||
takeover, optional PostgreSQL).
|
||||
|
||||
This repo does **not** vendor the fork's source. It pins an upstream commit, builds the .NET 10 server, and
|
||||
produces a runtime container image pushed to the Gitea registry.
|
||||
|
||||
## What it produces
|
||||
|
||||
`git.unkin.net/unkin/jellyfin-ha:<tag>` — an `mcr.microsoft.com/dotnet/aspnet:10.0` based image with ffmpeg and
|
||||
the prebuilt `jellyfin-web` client, running the published `jellyfin-ha` server.
|
||||
|
||||
## Layout
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `UPSTREAM_REF` | Pinned upstream commit SHA. Bumping the fork = edit this + cut a release. |
|
||||
| `Dockerfile.runtime` | Runtime-only image; `COPY`s the CI-produced `publish-output/` and the web client. |
|
||||
| `Makefile` | Local `make publish` / `make build`; `make patch\|minor\|major` to tag + push a release. |
|
||||
| `.woodpecker/build.yaml` | PR pipeline: `dotnet publish` + docker `dry_run`. |
|
||||
| `.woodpecker/docker.yaml` | Tag (`v*`) pipeline: `dotnet publish` + build & push to the Gitea registry. |
|
||||
|
||||
## Releasing
|
||||
|
||||
1. To track a newer upstream, update `UPSTREAM_REF` to the desired commit SHA and merge via PR.
|
||||
2. Cut a release: `make patch` (or `minor` / `major`) tags `vX.Y.Z` and pushes it, which triggers
|
||||
`.woodpecker/docker.yaml` to build and push `git.unkin.net/unkin/jellyfin-ha:vX.Y.Z` + `:latest`.
|
||||
|
||||
## Local build
|
||||
|
||||
```bash
|
||||
make build # clones pinned upstream, dotnet publish, docker build
|
||||
```
|
||||
|
||||
Requires the .NET 10 SDK and Docker. `make publish` runs just the clone + publish into `./publish-output`.
|
||||
|
||||
## Deployment
|
||||
|
||||
Deployed to Kubernetes via ArgoCD — see `argocd-apps` (`apps/base/jellyfin`, `media` ApplicationSet/project).
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
d4f9c12c22d3a640f3b0a3622b23b8cd01d044ad
|
||||
Reference in New Issue
Block a user