From 4be3368bffedb8ba551a17182d50157cd15c1833 Mon Sep 17 00:00:00 2001 From: Felix Seiboldt <52862870+devilAPI@users.noreply.github.com> Date: Fri, 27 Dec 2024 20:02:36 +0100 Subject: [PATCH] Update Dockerfile --- Dockerfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 626f103..4dec51d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,21 @@ # Use Navidrome as the base image FROM deluan/navidrome:latest +# Create a non-root user +RUN useradd -ms /bin/bash navidromeuser + # Set the working directory WORKDIR /home/container +# Create cache and data directories and set permissions for the user +RUN mkdir -p /home/container/cache /home/container/data /home/container/music \ + && chown -R navidromeuser:navidromeuser /home/container + # Expose the default Navidrome port EXPOSE 4533 -# Remove any default entrypoint (optional) -# ENTRYPOINT [] +# Set the user for running the container +USER navidromeuser # Set the default command to run Navidrome with arguments (this will be overridden in Pterodactyl) -#CMD ["navidrome --max-memory {{SERVER_MEMORY}} -port {{SERVER_PORT}} --music /home/container/music --cache /home/container/cache --data /home/container/data"] -#CMD ["navidrome --help"] +CMD ["navidrome", "--max-memory", "{{SERVER_MEMORY}}", "-port", "{{SERVER_PORT}}", "--music", "/home/container/music", "--cache", "/home/container/cache", "--data", "/home/container/data"]