deluge/Dockerfile
Arnaud G. GIBERT dc04aa9a4e - Switch to config onboarding mode,
- Enable AutoAdd plugin,
- Add TotalTraffic plugin.
2025-05-23 20:16:19 +02:00

79 lines
5.2 KiB
Docker

# Rx3-Docker/Deluge Dockerfile
#-------------------------------------------------------------------------------
ARG IMG_FROM_URL="rx3-docker/server:latest"
FROM ${IMG_FROM_URL}
ARG IMG_NAME
ARG IMG_NAME_FULL
ARG IMG_VERSION
ARG IMG_MAINTAINER
LABEL org.rx3.${IMG_NAME}.name=${IMG_NAME_FULL}
LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION}
LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER}
LABEL maintainer=${IMG_MAINTAINER}
ARG MODULE_PATH
ARG DELUGE_PORT_DAEMON
ARG DELUGE_PORT_WEB
ARG DELUGE_LIB=/var/lib/deluge
ARG DELUGE_SPOOL=/var/spool/deluge
ARG DELUGE_HOME=${DELUGE_LIB}
ARG DELUGE_CONFIG=${DELUGE_HOME}
ARG DELUGE_CONFIG_TEMPLATE=${DELUGE_HOME}-template
#-----------------------------------------------------------------------------------------------------------------------
ARG DELUGED='#!/bin/bash \n\
\n\
usermod -u ${DELUGE_UID} deluge \n\
groupmod -g ${DELUGE_GID} deluge \n\
\n\
if [[ ! -f '${DELUGE_CONFIG}'/auth ]] \n\
then \n\
cp -R '${DELUGE_CONFIG_TEMPLATE}'/* '${DELUGE_CONFIG}' \n\
\n\
sed -e "s/DELUGE_PORT_BT_LOW/${DELUGE_PORT_BT_LOW}/" -i '${DELUGE_CONFIG}'/core.conf \n\
sed -e "s/DELUGE_PORT_BT_HIGH/${DELUGE_PORT_BT_HIGH}/" -i '${DELUGE_CONFIG}'/core.conf \n\
fi \n\
\n\
for dir in torrent-auto torrent tmp completed \n\
do \n\
if [[ ! -d '${DELUGE_SPOOL}'/${dir} ]] \n\
then \n\
mkdir '${DELUGE_SPOOL}'/${dir} \n\
fi \n\
done \n\
\n\
chown -R deluge:deluge '${DELUGE_LIB}' '${DELUGE_SPOOL}
#-----------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------
ARG DELUGED_INI='[program:deluged] \n\
directory='${DELUGE_HOME}' \n\
command=deluged --config '${DELUGE_CONFIG}' --do-not-daemonize \n\
user=deluge \n\
environment=HOME='${DELUGE_HOME}
#-----------------------------------------------------------------------------------------------------------------------
RUN urpmi.update -a \
&& urpmi --force deluge myip --no-recommends \
&& useradd --home-dir ${DELUGE_HOME} --password "" deluge \
&& mkdir ${DELUGE_SPOOL} \
&& echo -e "${DELUGED}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/deluged \
&& chmod a+x /etc/init.d/deluged \
&& ln -s /etc/init.d/deluged /etc/rcD.d/S30deluged \
&& echo -e "${DELUGED_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/deluged.ini
ADD ${MODULE_PATH} ${DELUGE_CONFIG_TEMPLATE}
EXPOSE ${DELUGE_PORT_DAEMON}
EXPOSE ${DELUGE_PORT_WEB}