Created
January 17, 2015 23:51
-
-
Save mdevaev/679efe50b162bf3db41a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mdevaev/archlinux | |
MAINTAINER Devaev Maxim <mdevaev@gmail.com> | |
RUN pacman --noconfirm -Syy \ | |
&& pacman --noconfirm -S \ | |
python-setuptools \ | |
python-mako \ | |
lighttpd \ | |
php \ | |
php-cgi \ | |
&& pacman --noconfirm -Sc | |
RUN groupadd --system -g 5000 docker-daemon \ | |
&& useradd --system -u 5000 -g 5000 -m docker-daemon \ | |
&& setup-profile /home/docker-daemon | |
RUN wget https://bintray.com/artifact/download/novik65/generic/rutorrent-3.6.tar.gz -O rutorrent.tar.gz | |
RUN tar -xzf rutorrent.tar.gz \ | |
&& mv rutorrent/* /srv/http \ | |
&& chown docker-daemon:docker-daemon \ | |
/srv/http/share/settings \ | |
/run/lighttpd \ | |
/var/log/lighttpd \ | |
/var/cache/lighttpd \ | |
&& chmod 700 /srv/http/share/torrents /srv/http/share/users \ | |
&& sed -i -e 's|/tmp/errors.log||g' /srv/http/conf/config.php | |
ADD lighttpd.conf.mako /etc/lighttpd/lighttpd.conf.mako | |
CMD trap exit TERM \ | |
; ( mako-render \ | |
--var PORT="$PORT" \ | |
--var RTORRENT_HOST="$RTORRENT_HOST" \ | |
--var RTORRENT_PORT="$RTORRENT_PORT" \ | |
/etc/lighttpd/lighttpd.conf.mako > /etc/lighttpd/lighttpd.conf \ | |
&& sed -i -e "s|scgi_host = \"127\\.0\\.0\\.1\"|scgi_host = \"$RTORRENT_HOST\"|g" /srv/http/conf/config.php \ | |
&& sed -i -e "s|scgi_port = 5000|scgi_port = $RTORRENT_PORT|g" /srv/http/conf/config.php \ | |
&& lighttpd -D -f /etc/lighttpd/lighttpd.conf ) \ | |
& wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Config for ruTorrent | |
server.modules = ( | |
"mod_accesslog", | |
"mod_scgi", | |
"mod_fastcgi", | |
) | |
server.port = ${PORT} | |
server.username = "docker-daemon" | |
server.groupname = "docker-daemon" | |
server.document-root = "/srv/http" | |
server.errorlog = "/logs/error.log" | |
accesslog.filename = "/logs/access.log" | |
index-file.names = ( "index.html" ) | |
# http://habrahabr.ru/post/68301/ | |
server.max-keep-alive-requests = 4 | |
server.max-keep-alive-idle = 4 | |
server.max-read-idle = 10 | |
server.max-write-idle = 10 | |
server.event-handler = "linux-sysepoll" | |
fastcgi.server = ( | |
".php" => ( | |
"localhost" => ( | |
"socket" => "/run/lighttpd/fastcgi-php-"+PID+".socket", | |
"bin-path" => "/usr/bin/php-cgi", | |
), | |
), | |
) | |
scgi.server = ( | |
"/RPC2" => ( | |
"127.0.0.1" => ( | |
"host" => "${RTORRENT_HOST}", | |
"port" => ${RTORRENT_PORT}, | |
"check-local" => "disable", | |
), | |
), | |
) | |
mimetype.assign = ( | |
".html" => "text/html", | |
".css" => "text/css", | |
".js" => "application/x-javascript", | |
".jpg" => "image/jpeg", | |
".jpeg" => "image/jpeg", | |
".gif" => "image/gif", | |
".png" => "image/png", | |
"" => "application/octet-stream", | |
) |
Author
mdevaev
commented
Jan 17, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment