From bd02b50bafbc45c98511bdf5732253d5670468a7 Mon Sep 17 00:00:00 2001 From: Luigi Maselli Date: Tue, 28 Apr 2015 18:14:16 +0200 Subject: [PATCH] + Dockerfile and doc --- Dockerfile | 29 +++++++++++++++++++++++++++++ README.md | 18 ++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e2a48f8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +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" \ + && LATEST=`curl -s $GITHUB_REPO"/releases/latest" | grep -Eo "[0-9].[0-9]"` \ + && 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 +RUN echo -e "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 + +EXPOSE 8080 6800 +CMD ["goreman", "start"] diff --git a/README.md b/README.md index ab5d538..97e7ce3 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,24 @@ Dependencies ============ Well, you need aria2. And a web browser (if that even counts!) +Docker support +============== +You can also try or use webui-aria2 in your LAN inside a Docker sandbox. + +Build the image + +````bash +sudo docker build -t yourname/webui-aria2 . +```` + +..and run it! It will be available at: `http://localhost:9100` + +````bash +sudo docker run -v /Downloads:/data -p 6800:6800 -p 9100:8080 --name="webui-aria2" yourname/webui-aria2 +```` + +`/Downloads` is the directory in the host where you want to keep the downloaded files + Support ======= For any support, feature request and bug report add an issue in the github project. [link](https://github.com/ziahamza/webui-aria2/issues)