Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
devilAPI authored Dec 27, 2024
1 parent 4406717 commit 792fa93
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
# Use Navidrome as the base image
# Use deluan/navidrome base image
FROM deluan/navidrome:latest

# Install necessary package to create a user (for Alpine, use apk)
RUN apk update && apk add --no-cache shadow
# Create a user and group for Navidrome
RUN groupadd -g 1000 navidrome && useradd -u 1000 -g navidrome -m -s /bin/bash navidrome

# Create a non-root user
RUN useradd -ms /bin/bash navidromeuser
# Create necessary directories and give proper permissions
RUN mkdir -p /data/cache /data/music /data/config && chown -R navidrome:navidrome /data

# Set the working directory
WORKDIR /home/container
# Set working directory
WORKDIR /data

# 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
# Switch to the created non-root user
USER navidrome

# Expose the default Navidrome port
EXPOSE 4533

# 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"]
# Start Navidrome as the non-root user
CMD ["./navidrome"]

0 comments on commit 792fa93

Please sign in to comment.