navidrome: Move to Quadlet

This commit is contained in:
Alex Palaistras 2023-08-13 16:03:42 +01:00
parent 2679166819
commit 67e16b82df
4 changed files with 24 additions and 33 deletions

View File

@ -1,13 +1,11 @@
FROM docker.io/debian:bullseye-slim
FROM docker.io/debian:bookworm-slim
ARG VERSION=0.49.2
RUN apt-get update -y && apt-get upgrade -y && \
apt-get install -y --no-install-recommends curl ca-certificates gosu ffmpeg
ENV PACKAGE_URL https://github.com/deluan/navidrome/releases/download/v${VERSION}/navidrome_${VERSION}_Linux_x86_64.tar.gz
RUN curl -L ${PACKAGE_URL} | tar -C /bin --no-same-owner -xvzf - navidrome && chmod +x /bin/navidrome
RUN apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false curl
RUN apt-get update -y && apt-get upgrade -y && \
apt-get install -y --no-install-recommends curl ca-certificates gosu ffmpeg && \
curl -L ${PACKAGE_URL} | tar -C /bin --no-same-owner -xvzf - navidrome && chmod +x /bin/navidrome && \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false curl
RUN addgroup --system --gid 10000 navidrome
RUN adduser --system --uid 10000 --ingroup navidrome --home /var/lib/navidrome navidrome

View File

@ -0,0 +1,17 @@
[Unit]
Description=Navidrome music server
Wants=container-build@%N.service container-volume@%N.service
After=container-build@%N.service container-volume@%N.service
[Container]
ContainerName=%N
Image=localhost/%N:latest
Network=internal
Volume=%N:/var/lib/%N:z
Volume=%N-music:/music:z,ro
[Service]
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@ -4,9 +4,5 @@ storage:
trees:
- path: /etc/coreos-home-server/navidrome
local: service/navidrome/
- path: /etc/systemd/system
local: service/navidrome/systemd/
systemd:
units:
- name: navidrome.service
enabled: true
- path: /etc/containers/systemd
local: service/navidrome/quadlet/

View File

@ -1,20 +0,0 @@
[Unit]
Description=Navidrome Music Server
Wants=container-build@%N.service container-volume@%N.service
After=container-build@%N.service container-volume@%N.service
[Service]
Type=notify
NotifyAccess=all
SyslogIdentifier=%N
Restart=on-failure
Environment=PODMAN_SYSTEMD_UNIT=%n
ExecStart=/bin/podman run --replace --name %N --net internal --sdnotify=conmon \
--volume %N:/var/lib/%N:z \
--volume %N-music:/music:z,ro \
localhost/%N:latest
ExecStop=/bin/podman stop --ignore --time 10 %N
ExecStopPost=/bin/podman rm --ignore --force %N
[Install]
WantedBy=multi-user.target