2015-04-28 18:14:16 +02:00
|
|
|
FROM debian:8
|
|
|
|
|
|
|
|
# less priviledge user, the id should map the user the downloaded files belongs to
|
|
|
|
RUN groupadd -r dummy && useradd -r -g dummy dummy -u 1000
|
|
|
|
|
|
|
|
# webui + aria2
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y aria2 busybox curl \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
ADD . /webui-aria2
|
|
|
|
|
|
|
|
# gosu install latest
|
|
|
|
RUN GITHUB_REPO="https://github.com/tianon/gosu" \
|
2016-10-03 08:09:09 +02:00
|
|
|
&& LATEST=`curl -s $GITHUB_REPO"/releases/latest" | grep -Eo "[0-9].[0-9]*"` \
|
2015-04-28 18:14:16 +02:00
|
|
|
&& curl -L $GITHUB_REPO"/releases/download/"$LATEST"/gosu-amd64" > /usr/local/bin/gosu \
|
|
|
|
&& chmod +x /usr/local/bin/gosu
|
|
|
|
|
|
|
|
# goreman supervisor install latest
|
|
|
|
RUN GITHUB_REPO="https://github.com/mattn/goreman" \
|
|
|
|
&& LATEST=`curl -s $GITHUB_REPO"/releases/latest" | grep -Eo "v[0-9]*.[0-9]*.[0-9]*"` \
|
|
|
|
&& curl -L $GITHUB_REPO"/releases/download/"$LATEST"/goreman_linux_amd64.tar.gz" > goreman.tar.gz \
|
|
|
|
&& tar -xvzf goreman.tar.gz && mv /goreman_linux_amd64/goreman /usr/local/bin/goreman && rm -R goreman*
|
|
|
|
|
|
|
|
# goreman setup
|
2016-10-03 08:10:26 +02:00
|
|
|
RUN echo "web: gosu dummy /bin/busybox httpd -f -p 8080 -h /webui-aria2\nbackend: gosu dummy /usr/bin/aria2c --enable-rpc --rpc-listen-all --dir=/data" > Procfile
|
2015-04-28 18:14:16 +02:00
|
|
|
|
2016-10-08 06:16:27 +02:00
|
|
|
# aria2 downloads directory
|
2016-10-03 08:32:23 +02:00
|
|
|
VOLUME /data
|
2016-10-08 06:16:27 +02:00
|
|
|
|
|
|
|
# aria2 RPC port, map as-is or reconfigure webui
|
|
|
|
EXPOSE 6800/tcp
|
|
|
|
|
|
|
|
# webui static content web server, map wherever is convenient
|
|
|
|
EXPOSE 8080/tcp
|
2016-10-03 08:32:23 +02:00
|
|
|
|
|
|
|
CMD ["start"]
|
|
|
|
ENTRYPOINT ["/usr/local/bin/goreman"]
|