Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
Compile from source and run as a non-root user (uid=1000).
Browse files Browse the repository at this point in the history
  • Loading branch information
jordancrawfordnz committed Apr 3, 2016
1 parent 8fb4056 commit 4da1eca
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
29 changes: 24 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
# Sets up a Deluge server and web client.

FROM resin/rpi-raspbian:jessie

MAINTAINER Jordan Crawford <[email protected]>

# Setup deluged, deluge-web and deluge-console.
RUN apt-get update; apt-get install deluged deluge-web deluge-console -y
# Deluge version.
ARG DELUGE_VERSION=1.3.12

# Install deluge required packages.
RUN apt-get update; apt-get install wget python python-twisted python-openssl python-setuptools intltool python-xdg python-chardet geoip-database python-libtorrent python-notify python-pygame python-glade2 librsvg2-common xdg-utils python-mako -y

WORKDIR /
RUN wget http://download.deluge-torrent.org/source/deluge-${DELUGE_VERSION}.tar.gz
RUN tar -zxvf deluge-${DELUGE_VERSION}.tar.gz
RUN rm deluge-${DELUGE_VERSION}.tar.gz
RUN cd deluge-${DELUGE_VERSION}; python setup.py build; python setup.py install

# Expose the deluge control port and the web UI port.
EXPOSE 58846 8112

# Setup a user.
RUN adduser --system -u 1000 deluge

# Clean up.
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Setup volumes.
VOLUME /config
VOLUME /data

# Add the start script.
ADD start.sh /root/start.sh
ADD start.sh /start.sh

# Run the start script on boot.
CMD ["/root/start.sh"]
CMD ["/start.sh"]
11 changes: 8 additions & 3 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
CONFIGDIR=/config
DATADIR=/data

echo "Setting owner for config and data directories."
mkdir -p $CONFIGDIR
mkdir -p $DATADIR
chown -R deluge $CONFIGDIR
chown deluge $DATADIR

if [ ! -d $CONFIGDIR ]; then
echo "The config directory does not exist! Please add it as a volume."
exit 1
Expand Down Expand Up @@ -44,6 +50,5 @@ if [ $AUTHMISSING ]; then
fi

echo "Starting deluged and deluge-web."

deluged -c $CONFIGDIR
deluge-web -c $CONFIGDIR
su -s /bin/bash deluge -c 'deluged -c /config'
su -s /bin/bash deluge -c 'deluge-web -c /config'

0 comments on commit 4da1eca

Please sign in to comment.