feat: add Docker image, Helm chart and Gitea CI
CI / test (push) Successful in 3m35s
CI / smoke (push) Successful in 3m11s
CI / chart (push) Successful in 14s
CI / image (push) Failing after 5s

- multi-stage Dockerfile with ffmpeg on Alpine JRE 21
- Helm chart for k3s: library ConfigMap, Vault users secret, data PVC,
  read-only hostPath media, ingress, probes and security context
- Gitea Actions runs tests, smoke test and chart lint, then builds and
  pushes the image on main and version tags
This commit is contained in:
TapTap committed 2026-11-13 12:56:30 +00:00
1 parent 18a1d7cd19
commit 25331ec0e1
12 files changed
+494 -11

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
apiVersion: v2
name: musicmanager
description: Self-hosted OpenSubsonic music server
type: application
version: 0.1.0
appVersion: "0.1.0"
@@ -0,0 +1,33 @@
{{- define "musicmanager.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "musicmanager.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "musicmanager.labels" -}}
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" }}
app.kubernetes.io/name: {{ include "musicmanager.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{- define "musicmanager.selectorLabels" -}}
app.kubernetes.io/name: {{ include "musicmanager.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "musicmanager.image" -}}
{{- printf "%s:%s" .Values.image.repository (default .Chart.AppVersion .Values.image.tag) -}}
{{- end -}}
@@ -0,0 +1,16 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "musicmanager.fullname" . }}-library
labels:
{{- include "musicmanager.labels" . | nindent 4 }}
data:
library.yaml: |
library:
folders:
{{- range .Values.library.folders }}
- id: {{ .id }}
name: {{ .name | quote }}
type: {{ .type }}
path: {{ .path | quote }}
{{- end }}
@@ -0,0 +1,118 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "musicmanager.fullname" . }}
labels:
{{- include "musicmanager.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: Recreate
selector:
matchLabels:
{{- include "musicmanager.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "musicmanager.selectorLabels" . | nindent 8 }}
annotations:
checksum/library: {{ include (print $.Template.BasePath "/configmap-library.yaml") . | sha256sum }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: musicmanager
image: "{{ include "musicmanager.image" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
env:
- name: PORT
value: "8080"
- name: DATA_DIR
value: /data
- name: LIBRARY_CONFIG
value: /etc/musicmanager/library.yaml
- name: USERS_FILE
value: /etc/musicmanager/users.yaml
- name: FFMPEG_PATH
value: ffmpeg
{{- with .Values.env }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8080
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
periodSeconds: 20
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 10
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: library
mountPath: /etc/musicmanager/library.yaml
subPath: library.yaml
readOnly: true
- name: users
mountPath: /etc/musicmanager/users.yaml
subPath: {{ .Values.users.key }}
readOnly: true
- name: data
mountPath: /data
- name: tmp
mountPath: /tmp
- name: music
mountPath: {{ .Values.media.music.mountPath }}
readOnly: true
- name: longform
mountPath: {{ .Values.media.longform.mountPath }}
readOnly: true
volumes:
- name: library
configMap:
name: {{ include "musicmanager.fullname" . }}-library
- name: users
secret:
secretName: {{ required "users.existingSecret is required" .Values.users.existingSecret }}
- name: data
{{- if .Values.data.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ include "musicmanager.fullname" . }}-data
{{- else }}
emptyDir: {}
{{- end }}
- name: tmp
emptyDir: {}
- name: music
hostPath:
path: {{ .Values.media.music.hostPath }}
type: Directory
- name: longform
hostPath:
path: {{ .Values.media.longform.hostPath }}
type: Directory
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -0,0 +1,29 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "musicmanager.fullname" . }}
labels:
{{- include "musicmanager.labels" . | nindent 4 }}
spec:
{{- with .Values.ingress.className }}
ingressClassName: {{ . }}
{{- end }}
{{- if .Values.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.ingress.host | quote }}
secretName: {{ .Values.ingress.tls.secretName }}
{{- end }}
rules:
- host: {{ .Values.ingress.host | quote }}
http:
paths:
- path: {{ .Values.ingress.path }}
pathType: {{ .Values.ingress.pathType }}
backend:
service:
name: {{ include "musicmanager.fullname" . }}
port:
name: http
{{- end }}
+17
View File
@@ -0,0 +1,17 @@
{{- if .Values.data.persistence.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "musicmanager.fullname" . }}-data
labels:
{{- include "musicmanager.labels" . | nindent 4 }}
spec:
accessModes:
{{- toYaml .Values.data.persistence.accessModes | nindent 4 }}
{{- with .Values.data.persistence.storageClass }}
storageClassName: {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.data.persistence.size }}
{{- end }}
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "musicmanager.fullname" . }}
labels:
{{- include "musicmanager.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
selector:
{{- include "musicmanager.selectorLabels" . | nindent 4 }}
ports:
- name: http
port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
+88
View File
@@ -0,0 +1,88 @@
replicaCount: 1
image:
repository: gitea.tap-tap.win/tap-tap/audiomanager
tag: "" # defaults to appVersion
pullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
# Rendered into a ConfigMap as /etc/musicmanager/library.yaml.
# Keep folder IDs stable: they are part of song IDs.
library:
folders:
- id: 1
name: "Music"
type: music
path: /mnt/media/music
- id: 10
name: "Audiobooks & Podcasts"
type: longform
path: /mnt/media/longform
# Vault-managed users.yaml. The secret must already exist and contain the key below.
users:
existingSecret: musicmanager-users
key: users.yaml
data:
persistence:
enabled: true
size: 5Gi
storageClass: ""
accessModes:
- ReadWriteOnce
# hostPath mounts shared by every schedulable node. Read-only in the pod.
media:
music:
hostPath: /mnt/media/music
mountPath: /mnt/media/music
longform:
hostPath: /mnt/media/longform
mountPath: /mnt/media/longform
service:
type: ClusterIP
port: 8080
ingress:
enabled: true
className: traefik
host: subsonic.tap-tap.win
path: /
pathType: Prefix
tls:
enabled: true
secretName: subsonic-tap-tap-win-tls
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 1000m
memory: 512Mi
podSecurityContext:
fsGroup: 10001
securityContext:
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
env:
- name: WEB_UI
value: "true"
nodeSelector: {}
tolerations: []
affinity: {}