-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allowing for runtime config of puid & pgid
Signed-off-by: Jeff Billimek <[email protected]>
- Loading branch information
Showing
4 changed files
with
41 additions
and
20 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 |
---|---|---|
|
@@ -3,21 +3,21 @@ FROM alpine | |
LABEL maintainer="Gianluca Gabrielli" mail="[email protected]" | ||
LABEL description="rTorrent on Alpine Linux, with a better Docker integration." | ||
LABEL website="https://github.com/TuxMeaLux/alpine-rtorrent" | ||
LABEL version="1.0" | ||
LABEL version="1.1" | ||
|
||
ARG UGID=666 | ||
|
||
RUN addgroup -g $UGID rtorrent && \ | ||
adduser -S -u $UGID -G rtorrent rtorrent && \ | ||
apk add --no-cache rtorrent && \ | ||
RUN apk upgrade && \ | ||
apk add --no-cache rtorrent su-exec && \ | ||
mkdir -p /home/rtorrent/rtorrent/config.d && \ | ||
mkdir /home/rtorrent/rtorrent/.session && \ | ||
mkdir /home/rtorrent/rtorrent/download && \ | ||
mkdir /home/rtorrent/rtorrent/watch && \ | ||
chown -R rtorrent:rtorrent /home/rtorrent/rtorrent | ||
mkdir -p /home/rtorrent/rtorrent/.session && \ | ||
mkdir -p /home/rtorrent/rtorrent/download && \ | ||
mkdir -p /home/rtorrent/rtorrent/watch && \ | ||
ln -sf /dev/stdout /var/log/rtorrent-info.log && \ | ||
ln -sf /dev/stderr /var/log/rtorrent-error.log && \ | ||
rm -rf /var/cache/apk/* | ||
|
||
COPY --chown=rtorrent:rtorrent config.d/ /home/rtorrent/rtorrent/config.d/ | ||
COPY --chown=rtorrent:rtorrent .rtorrent.rc /home/rtorrent/ | ||
COPY config.d/ /home/rtorrent/rtorrent/config.d/ | ||
COPY .rtorrent.rc /home/rtorrent/ | ||
COPY init / | ||
|
||
VOLUME /home/rtorrent/rtorrent/.session | ||
|
||
|
@@ -26,6 +26,4 @@ EXPOSE 6881 | |
EXPOSE 6881/udp | ||
EXPOSE 50000 | ||
|
||
USER rtorrent | ||
|
||
CMD ["rtorrent"] | ||
CMD ["/init"] |
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
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,6 +1,11 @@ | ||
## Logging: | ||
## Levels = critical error warn notice info debug | ||
method.insert = cfg.logfile, private|const|string, (cat,"/dev/stdout") | ||
log.open_file = "log", (cfg.logfile) | ||
log.add_output = "info", "log" | ||
log.add_output = "torrent_info", "log" | ||
method.insert = cfg.logs, private|const|string, (cat,"/var/log/") | ||
method.insert = cfg.info_logfile, private|const|string, (cat,(cfg.logs),"rtorrent-info.log") | ||
method.insert = cfg.error_logfile, private|const|string, (cat,(cfg.logs),"rtorrent-error.log") | ||
log.open_file = "info-log", (cfg.info_logfile) | ||
log.add_output = "info", "info-log" | ||
log.open_file = "error-log", (cfg.error_logfile) | ||
log.add_output = "critical", "error-log" | ||
log.add_output = "error", "error-log" | ||
log.add_output = "warn", "error-log" |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
PUID=${PUID:=666} | ||
PGID=${PGID:=666} | ||
|
||
# chown rTorrent home directory | ||
chown -R "$PUID:$PGID" /home/rtorrent | ||
|
||
chown "$PUID:$PGID" \ | ||
/var/log/rtorrent-error.log \ | ||
/var/log/rtorrent-info.log | ||
|
||
cd /home/rtorrent | ||
|
||
exec su-exec $PUID:$PGID rtorrent -n -o import=/home/rtorrent/.rtorrent.rc |