forked from romancin/rutorrent-flood-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·218 lines (198 loc) · 6.67 KB
/
Dockerfile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
FROM lsiobase/alpine:3.8
MAINTAINER romancin
# set version label
ARG BUILD_DATE
ARG VERSION
ARG BUILD_CORES
LABEL build_version="Romancin version:- ${VERSION} Build-date:- ${BUILD_DATE}"
# package version
ARG MEDIAINF_VER="18.05"
ARG RTORRENT_VER="0.9.6"
ARG LIBTORRENT_VER="0.13.6"
ARG CURL_VER="7.61.0"
ARG FLOOD_VER="1.0.0"
# set env
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
ENV LD_LIBRARY_PATH=/usr/local/lib
ENV FLOOD_SECRET=password
ENV CONTEXT_PATH=/
RUN NB_CORES=${BUILD_CORES-`getconf _NPROCESSORS_CONF`} && \
apk add --no-cache \
bash-completion \
ca-certificates \
fcgi \
ffmpeg \
geoip \
gzip \
logrotate \
nginx \
dtach \
tar \
unrar \
unzip \
sox \
wget \
irssi \
irssi-perl \
zlib \
zlib-dev \
libxml2-dev \
perl-archive-zip \
perl-net-ssleay \
perl-digest-sha1 \
git \
libressl \
binutils \
findutils \
zip \
php7 \
php7-cgi \
php7-fpm \
php7-json \
php7-mbstring \
php7-sockets \
php7-pear && \
# install build packages
apk add --no-cache --virtual=build-dependencies \
autoconf \
automake \
cppunit-dev \
perl-dev \
file \
g++ \
gcc \
libtool \
make \
ncurses-dev \
build-base \
libtool \
subversion \
cppunit-dev \
linux-headers \
curl-dev \
libressl-dev && \
# compile curl to fix ssl for rtorrent
cd /tmp && \
mkdir curl && \
cd curl && \
wget -qO- https://curl.haxx.se/download/curl-${CURL_VER}.tar.gz | tar xz --strip 1 && \
./configure --with-ssl && make -j ${NB_CORES} && make install && \
ldconfig /usr/bin && ldconfig /usr/lib && \
# install webui
mkdir -p \
/usr/share/webapps/rutorrent \
/defaults/rutorrent-conf && \
git clone https://github.com/Novik/ruTorrent.git \
/usr/share/webapps/rutorrent/ && \
mv /usr/share/webapps/rutorrent/conf/* \
/defaults/rutorrent-conf/ && \
rm -rf \
/defaults/rutorrent-conf/users && \
# install webui extras
# QuickBox Theme
git clone https://github.com/QuickBox/club-QuickBox /usr/share/webapps/rutorrent/plugins/theme/themes/club-QuickBox && \
git clone https://github.com/Phlooo/ruTorrent-MaterialDesign /usr/share/webapps/rutorrent/plugins/theme/themes/MaterialDesign && \
# ruTorrent plugins
cd /usr/share/webapps/rutorrent/plugins/ && \
git clone https://github.com/orobardet/rutorrent-force_save_session force_save_session && \
git clone https://github.com/AceP1983/ruTorrent-plugins && \
mv ruTorrent-plugins/* . && \
rm -rf ruTorrent-plugins && \
apk add --no-cache cksfv && \
git clone https://github.com/nelu/rutorrent-thirdparty-plugins.git && \
mv rutorrent-thirdparty-plugins/* . && \
rm -rf rutorrent-thirdparty-plugins && \
cd /usr/share/webapps/rutorrent/ && \
chmod 755 plugins/filemanager/scripts/* && \
rm -rf plugins/fileupload && \
cd /tmp && \
git clone https://github.com/mcrapet/plowshare.git && \
cd plowshare/ && \
make install && \
cd .. && \
rm -rf plowshare* && \
apk add --no-cache unzip bzip2 && \
cd /tmp && \
wget http://www.rarlab.com/rar/rarlinux-x64-5.4.0.tar.gz && \
tar zxvf rarlinux-x64-5.4.0.tar.gz && \
mv rar/rar /usr/bin && \
mv rar/unrar /usr/bin && \
rm -rf rar;rm rarlinux-* && \
cd /usr/share/webapps/rutorrent/plugins/ && \
git clone https://github.com/Gyran/rutorrent-pausewebui pausewebui && \
git clone https://github.com/Gyran/rutorrent-ratiocolor ratiocolor && \
sed -i 's/changeWhat = "cell-background";/changeWhat = "font";/g' /usr/share/webapps/rutorrent/plugins/ratiocolor/init.js && \
git clone https://github.com/Gyran/rutorrent-instantsearch instantsearch && \
git clone https://github.com/xombiemp/rutorrentMobile && \
git clone https://github.com/dioltas/AddZip && \
# install autodl-irssi perl modules
perl -MCPAN -e 'my $c = "CPAN::HandleConfig"; $c->load(doit => 1, autoconfig => 1); $c->edit(prerequisites_policy => "follow"); $c->edit(build_requires_install_policy => "yes"); $c->commit' && \
curl -L http://cpanmin.us | perl - App::cpanminus && \
cpanm HTML::Entities XML::LibXML JSON JSON::XS && \
# compile xmlrpc-c
cd /tmp && \
svn checkout http://svn.code.sf.net/p/xmlrpc-c/code/stable xmlrpc-c && \
cd /tmp/xmlrpc-c && \
./configure --with-libwww-ssl --disable-wininet-client --disable-curl-client --disable-libwww-client --disable-abyss-server --disable-cgi-server && make -j ${NB_CORES} && make install && \
# compile libtorrent
apk add -X http://dl-cdn.alpinelinux.org/alpine/v3.6/main -U cppunit-dev==1.13.2-r1 cppunit==1.13.2-r1 && \
cd /tmp && \
mkdir libtorrent && \
cd libtorrent && \
wget -qO- https://github.com/rakshasa/libtorrent/archive/${LIBTORRENT_VER}.tar.gz | tar xz --strip 1 && \
./autogen.sh && ./configure && make -j ${NB_CORES} && make install && \
# compile rtorrent
cd /tmp && \
mkdir rtorrent && \
cd rtorrent && \
wget -qO- https://github.com/rakshasa/rtorrent/archive/${RTORRENT_VER}.tar.gz | tar xz --strip 1 && \
./autogen.sh && ./configure --with-xmlrpc-c && make -j ${NB_CORES} && make install && \
# compile mediainfo packages
curl -o \
/tmp/libmediainfo.tar.gz -L \
"http://mediaarea.net/download/binary/libmediainfo0/${MEDIAINF_VER}/MediaInfo_DLL_${MEDIAINF_VER}_GNU_FromSource.tar.gz" && \
curl -o \
/tmp/mediainfo.tar.gz -L \
"http://mediaarea.net/download/binary/mediainfo/${MEDIAINF_VER}/MediaInfo_CLI_${MEDIAINF_VER}_GNU_FromSource.tar.gz" && \
mkdir -p \
/tmp/libmediainfo \
/tmp/mediainfo && \
tar xf /tmp/libmediainfo.tar.gz -C \
/tmp/libmediainfo --strip-components=1 && \
tar xf /tmp/mediainfo.tar.gz -C \
/tmp/mediainfo --strip-components=1 && \
cd /tmp/libmediainfo && \
./SO_Compile.sh && \
cd /tmp/libmediainfo/ZenLib/Project/GNU/Library && \
make install && \
cd /tmp/libmediainfo/MediaInfoLib/Project/GNU/Library && \
make install && \
cd /tmp/mediainfo && \
./CLI_Compile.sh && \
cd /tmp/mediainfo/MediaInfo/Project/GNU/CLI && \
make install && \
# install flood webui
apk add --no-cache \
python \
nodejs \
nodejs-npm && \
mkdir /usr/flood && \
cd /usr/flood && \
git clone https://github.com/jfurrow/flood . && \
cp config.template.js config.js && \
npm install -g node-gyp && \
npm install && \
npm cache clean --force && \
npm run build && \
rm config.js && \
# cleanup
apk del --purge \
build-dependencies && \
apk del -X http://dl-cdn.alpinelinux.org/alpine/v3.6/main cppunit-dev && \
rm -rf \
/tmp/*
# add local files
COPY root/ /
# ports and volumes
EXPOSE 443 51415 3000
VOLUME /config /downloads