-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |