-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
54 lines (49 loc) · 1.7 KB
/
Copy pathdockerfile
File metadata and controls
54 lines (49 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM alpine:3
ENV TZ=Asia/Shanghai
ARG ARIA_NG_VERSION=1.3.11
RUN apk update && \
apk add nginx unzip aria2 supervisor tzdata && \
mkdir -p /etc/aria2 /etc/supervisor.d /downloads /run/nginx && \
touch /aria2.session && \
echo -e "dir=/downloads\n\
disk-cache=32M\n\
continue=true\n\
max-concurrent-downloads=10\n\
max-connection-per-server=5\n\
min-split-size=10M\n\
split=10\n\
input-file=/aria2.session\n\
save-session=/aria2.session\n\
save-session-interval=5\n\
enable-rpc=true\n\
rpc-allow-origin-all=true\n\
rpc-listen-all=false\n\
bt-detach-seed-only=true\n\
" > /etc/aria2/aria2.conf && \
echo -e "[program:aria2]\n\
command=/usr/bin/aria2c --conf-path=/etc/aria2/aria2.conf\n" > /etc/supervisor.d/aria2.ini && \
echo -e "[program:nginx]\n\
command=/usr/sbin/nginx -g 'daemon off;'\n" > /etc/supervisor.d/nginx.ini && \
echo -e 'server {\n\
listen 80;\n\
location / {\n\
root /srv;\n\
index index.html index.htm;\n\
}\n\
location /jsonrpc {\n\
proxy_pass http://localhost:6800/jsonrpc;\n\
proxy_redirect off;\n\
proxy_set_header X-Real-IP $remote_addr;\n\
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\
proxy_set_header Host $host;\n\
proxy_http_version 1.1;\n\
proxy_set_header Upgrade $http_upgrade;\n\
proxy_set_header Connection "upgrade";\n\
}\n\
}' > /etc/nginx/http.d/default.conf && \
wget -O /tmp/ariang.zip https://github.com/mayswind/AriaNg/releases/download/$ARIA_NG_VERSION/AriaNg-$ARIA_NG_VERSION-AllInOne.zip && \
cd /srv && \
unzip /tmp/ariang.zip index.html && \
rm /tmp/ariang.zip
COPY entrypoint.sh /
CMD /entrypoint.sh