Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
FROM debian:jessie
MAINTAINER leafney "babycoolzx@126.com"

ENV RPC_PORT=6800 \
KODE_PORT=80 \
ARIANG_PORT=6801 \
GOSU_VERSION=1.10 \
KODE_VERSION=4.21 \
ARIANG_VERSION=0.2.0
ENV KODE_PORT=6880 \
GOSU_VERSION=1.11 \
KODE_VERSION=4.39 \

RUN echo "deb http://mirrors.ustc.edu.cn/debian jessie main contrib non-free" > /etc/apt/sources.list \
&& echo "deb-src http://mirrors.ustc.edu.cn/debian jessie main contrib non-free" >> /etc/apt/sources.list \
&& apt-get update && apt-get install -y \
RUN apt-get update && apt-get install -y \
aria2 \
unzip \
supervisor \
Expand All @@ -29,9 +24,6 @@ RUN echo "deb http://mirrors.ustc.edu.cn/debian jessie main contrib non-free" >
&& rm -rf /var/lib/apt/lists/* \
&& aria2c -o /usr/local/bin/gosu https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64 \
&& chmod +x /usr/local/bin/gosu \
&& aria2c -o /web/ariang.zip https://github.com/mayswind/AriaNg/releases/download/${ARIANG_VERSION}/aria-ng-${ARIANG_VERSION}.zip \
&& unzip /web/ariang.zip -d /web/ariaNg \
&& rm /web/ariang.zip \
&& aria2c -o /web/kode.zip https://github.com/kalcaddle/KodExplorer/archive/${KODE_VERSION}.zip \
&& unzip /web/kode.zip -d /web \
&& mv /web/KodExplorer-${KODE_VERSION}/* /web/kode/ \
Expand All @@ -47,6 +39,6 @@ ENTRYPOINT ["docker-entrypoint.sh"]

VOLUME ["/app"]

EXPOSE $RPC_PORT $ARIANG_PORT $KODE_PORT
EXPOSE $KODE_PORT

CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
感谢原作者,在原作者基础上更新了KodExplorer版本,修复AriaNg链接问题,重新打包上传镜像

### Docker + debian + Aria2 + KodExplorer

#### default ENV
Expand All @@ -6,15 +8,19 @@
* `KODE_PORT` `80`
* `ARIANG_PORT` `6801`
* `RPC_SECRET` `123456`
* `GOSU_VERSION` `1.11`
* `KODE_VERSION` `4.39`
* `ARIANG_VERSION` `1.0.1`


#### run default aria2 docker

```
$ docker run --name kode -d -p 6800:6800 -p 6801:6801 -p 6860:80 leafney/debian-aria2-kode
$ docker run --name kode -d -p 6800:6800 -p 6801:6801 -p 6860:80 tozehu/debian-aria2-kode
```

#### run custom aria2 docker

```
$ docker run --name kode -d -e "RPC_PORT=6820" -e "RPC_SECRET=987654" -p 6821:6820 -p 6822:6801 -p 6860:80 -v /home/tiger/kode:/app leafney/debian-aria2-kode
$ docker run --name kode -d -e "RPC_PORT=6820" -e "RPC_SECRET=987654" -p 6821:6820 -p 6822:6801 -p 6860:80 -v /home/tiger/kode:/app tozehu/debian-aria2-kode
```
42 changes: 1 addition & 41 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
set -e

# env
RPC_SECRET=${RPC_SECRET:-"123456"}

echo "***** set php web config *****"

Expand All @@ -20,24 +19,12 @@ cat << EOF > $apache2_conf
</Directory>
</VirtualHost>

<VirtualHost *:${ARIANG_PORT}>
ServerAdmin webmaster2@localhost
DocumentRoot /web/ariaNg
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /web/ariaNg/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
EOF

echo "***** set php web port *****"
port_conf="/etc/apache2/ports.conf"
cat << EOF > $port_conf
Listen ${KODE_PORT}
Listen ${ARIANG_PORT}

<IfModule ssl_module>
Listen 443
Expand All @@ -48,36 +35,9 @@ Listen ${ARIANG_PORT}
</IfModule>
EOF

aria2_conf="/app/conf/aria2.conf"
aria2_session="/app/conf/aria2.session"

if [ -f "$aria2_conf" ]; then
echo "***** Loading aria2 config *****"
else
echo "***** Creating default aria2 config *****"
mkdir -p /app/conf

cat << EOF >> $aria2_conf
dir=/app/aria2down
continue=true
input-file=/app/conf/aria2.session
save-session=/app/conf/aria2.session
disable-ipv6=true
enable-rpc=true
rpc-allow-origin-all=true
rpc-listen-all=true
rpc-listen-port=$RPC_PORT
rpc-secret=$RPC_SECRET
EOF

fi

if [ -f "$aria2_session" ]; then
echo "***** Loading aria2 session file *****"
else
echo "***** Creating default aria2 session file *****"
touch $aria2_session
fi

mkdir -p /app/aria2down
mkdir -p /app/logs
Expand All @@ -87,4 +47,4 @@ chmod -Rf 777 /web/
chmod -Rf 777 /app/

echo "***** Done *****"
exec "$@"
exec "$@"
10 changes: 1 addition & 9 deletions start.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
[supervisord]
nodaemon=true

[program:aria2]
command=gosu www-data aria2c --conf-path=/app/conf/aria2.conf
directory=/
user=root
autostart=true
autorestart=true
stdout_logfile=/app/logs/aria2out.log
stderr_logfile=/app/logs/aria2err.log

[program:apache2]
command=/usr/sbin/apache2ctl -D "FOREGROUND" -k start
Expand All @@ -20,4 +12,4 @@ redirect_stderr=true
killasgroup=true
stopasgroup=true
stdout_logfile=/app/logs/apache2out.log
stderr_logfile=/app/logs/apache2err.log
stderr_logfile=/app/logs/apache2err.log