Flood: Is there a docker image for flood?

Created on 11 Jul 2016  Â·  27Comments  Â·  Source: Flood-UI/flood

Hello there !
I'm using docker on my VPS and I was wondering if you have planned to release an docker image or if it already exists.
By the way, I don't see on your readme if flood is multi-user or not. It's a lot better to store specific configuration files for each user by just using the authentification with nginx & htaccess - instead of creating 1 VM per user.

docker enhancement

Most helpful comment

Is there a docker image for flood? #79 ==> Now there is https://github.com/jfurrow/flood/pull/304 & https://github.com/jfurrow/flood/pull/370

May be we can close this issue? Still possible to open a new one if problem with the docker container.

All 27 comments

I do not have a docker image created (though I agree it would make sense). If you'd be willing to submit a PR for it, I'd gladly accept it!

Flood has no concept of user permissions by any means. Right now you can create multiple user accounts, but they all have the same permission — either full access to the Flood API, or none. I do plan to add role-specific permissions in the future, but to be honest I consider it to be a very low priority in comparison to other core features.

I'm not entirely sure what you're talking about by storing specific configuration files for each user and authenticating with nginx and htaccess. Could you expand on this?

If you'd be willing to submit a PR for it, I'd gladly accept it!

I can create a working docker image, but I'm not experienced with baseimage-docker (in order to create the cleanest image possible).

I never run Flood, but if you create 2 users they will share the same XMLRPC entry point no ? So if I'm correct, that means they will see the same torrent list on the HMI.

I'm not entirely sure what you're talking about by storing specific configuration files for each user and authenticating with nginx and htaccess.

In my case, each user has his own rtorrent process with his own XMLRPC entry point. When an user opens the webpage, nginx (or apache) asks for a user / password. The user enters one of the declared user of the .htpasswd file and he gets connected. From that, rutorrent gets the username and loads the config file for that user /path/to/rutorrent/conf/users/{username}/config.php, here is an example :

<?php
$topDirectory = '/downloads/torrents/user4/';
$scgi_host = "localhost";
$scgi_port = 5006;
$XMLRPCMountPoint = '/RPCUSER4';

That allows me to create one VM for all users of my server instead of 1 VM for each user.

This is how it's done on ruTorrent : https://github.com/Novik/ruTorrent/blob/master/php/util.php#L11
And their issue when they implemented multi user : https://github.com/Novik/ruTorrent/issues/136

I've been thinking about multi-user for a while. Let me explain what I was thinking about:

Technically (I think) you can run multiple users who have all their own torrents, tags & settings on one Flood instance and one rTorrent instance. Flood could for example link torrents to a user and only show the torrents added by this user.

I am not sure if this is a good thing to do but the idea sounds nice IMO. Let's discuss it. 😄

@serut:

  1. Re: mult-user, wow. I had no idea ruTorrent had this ability. Thanks for the explanation. I agree that solution is pretty solid.
  2. Re: Docker images, I unfortunately have even less experience with Docker (though I really should get my feet wet). I'll do some more research on baseimage-docker. But still feel free to submit a PR if you get something together first. :)

@mahoek While that would be possible, it doesn't feel right to me because Flood would essentially just be filtering data from rTorrent for each user. It seems like there's a lot of room for error (and a fair amount of overhead in filtering the data). I think it would probably be easier and more secure to handle separate instances of rTorrent.

I'd like to commit to implementing support for multiple rTorrent instances per user, but I think it's a low priority for now.

@mahoek if you have a daemon per user you can control basically everything from speed limit, torrent limit, disk limit, and it consumes a few amount of RAM. You just need to open a lot of ports, but it's not big deal.

@jfurrow

I'd like to commit to implementing support for multiple rTorrent instances per user, but I think it's a low priority for now.

Why such functionnality ? Example: you send a torrent from the HMI and you need to choose what daemon will handle that file ? Overkill.
Let's get back to the original subject, I think multi user requires his own issue.

But still feel free to submit a PR if you get something together first. :)

To be more precise, Docker images are not stored aside the project but on the dockerhub website (and has own repository).


I've created a working docker image but I failed to connect flood to rtorrent. I have two dockers instances, one with rtorrent and nginx as proxy and the other with flood and a reverse nginx proxy too.
Whereas Sickrage lets me use XMLRPC with authentification support, flood does not and I'm stuck with these errors:

# Inside Flood container
Trace: [Error: Unknown XML-RPC tag 'TITLE']
    at ClientRequest.onCompleteFn (/opt/flood/server/util/ajaxUtil.js:7:17)
    at ClientRequest.handleError (/opt/flood/server/models/ClientRequest.js:69:12)
    at _rejected (/opt/flood/node_modules/q/q.js:844:24)
    at /opt/flood/node_modules/q/q.js:870:30
    at Promise.when (/opt/flood/node_modules/q/q.js:1122:31)
    at Promise.promise.promiseDispatch (/opt/flood/node_modules/q/q.js:788:41)
    at /opt/flood/node_modules/q/q.js:604:44
    at runSingle (/opt/flood/node_modules/q/q.js:137:13)
    at flush (/opt/flood/node_modules/q/q.js:125:13)
    at nextTickCallbackWith0Args (node.js:420:9)
Trace: [Error: Unknown XML-RPC tag 'TITLE']

It would be nice to display something to the end user, like "Failed to connect to rTorrent daemon" on the HMI instead of the (very nice) loading.

# Browser console
xhr.js:161 GET http://mydomain/api/stats 500 (Internal Server Error)xhrAdapter @ xhr.js:161executor @ dispatchRequest.js:27dispatchRequest @ dispatchRequest.js:11
xhr.js:161 GET http://mydomain/api/client/torrents 500 (Internal Server Error)xhrAdapter @ xhr.js:161executor @ dispatchRequest.js:27dispatchRequest @ dispatchRequest.js:11
xhr.js:161 GET http://mydomain/api/client/settings 500 (Internal Server Error)

Edit: it's working well on sickrage if I use what I'm using on Flood :-1:
capture

Dockerfile:

FROM linuxserver/baseimage

# install packages
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash - && \
    apt-get install build-essential git-core libssl-dev nodejs nginx supervisor -qy && \
    npm install -g npm@latest && \
    apt-get clean && \
    rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*

# configure supervisor
COPY supervisord.conf /etc/supervisor/conf.d/

# Load in all of our config files.
COPY nginx.conf /etc/nginx/

# install flood
RUN mkdir /opt/flood && \
    git clone https://github.com/jfurrow/flood /opt/flood && \
    cd /opt/flood && npm install

# configure flood
COPY config.flood.js /opt/flood/config.js

EXPOSE 9000

CMD ["supervisord"]

config.flood.js:

const config = {
  dbCleanInterval: 1000 * 60 * 60,
  dbPath: './server/db/',
  floodServerPort: 3000,
  maxHistoryStates: 30,
  pollInterval: 1000 * 5,
  secret: 'flood',
  scgi: {
    host: 'rtorrent_hostname',
    port: 25001,
    socket: false,
    socketPath: '/tmp/rtorrent.sock'
  }
};

module.exports = config;

nginx.conf

# vim: ft=nginx

user root root;

worker_processes auto;
pid /run/nginx.pid;

events {
    worker_connections 4096;
    use                epoll;
    multi_accept       on;
}

http {
    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include      /etc/nginx/mime.types;
    default_type application/octet-stream;

    access_log /var/log/nginx/access.log combined;
    error_log /var/log/nginx/error.log error;

    gzip         on;
    gzip_disable "msie6";

    server {
        listen 9000 default_server;

        server_name flood;
        root /opt/flood;
        client_max_body_size 5G;

        location / {
            proxy_pass http://localhost:3000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
        }

        location ~* "/\.(htaccess|htpasswd)$" {
            deny    all;
            return  404;
        }
    }
   #This is a none-working test
    server {
        listen 5001 default_server;

        location / {
            include scgi_params;
            scgi_pass rtorrent_hostname:25001;
        }
    }
}

supervisord.conf:

; vim: ft=dosini
[supervisord]
nodaemon = true

[program:flood-node]
priority = 1
directory = /opt/flood
command = npm start
autorestart = true

[program:nginx]
priority = 2
command = nginx -g "daemon off;"
autorestart = true

nginx.conf of rtorrent

...
[..]
http {
    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;
    include      /etc/nginx/mime.types;
    default_type application/octet-stream;
    access_log /var/log/nginx/access.log combined;
    error_log /var/log/nginx/error.log error;
    gzip         on;
    gzip_disable "msie6";
    client_max_body_size 8M;
    server {

        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on; 
        auth_basic           "Restricted";
        auth_basic_user_file /etc/nginx/.htpasswd;
        server_name rtorrent;
        root /var/www/rutorrent;
        index index.php index.html index.htm;
        # This is working with Sickrage
        location /RPCUSER1 {
             include scgi_params;
             scgi_pass 127.0.0.1:5001;
    }
        [...]
   }
  # This is not working, but there are no password required in theory
   server {
        listen 25001 default_server;
        auth_basic "off";
        location / {
            include scgi_params;
            scgi_pass 127.0.0.1:5001;
        }
    }

@mahoek on the issue #36 you say

I fired up a Docker container with rtorrent and made flood connect with it.

Can you tell me how flood connects to your dockerised rtorrent ?
On my setup, it fails to reach scgi://localhost:25001, but I don't know why.
Also, can you execute the following ?

ns3026433:/home/serut/seedbox-docker# docker exec -ti seedboxdocker_rtorrent_1 bash
root@d7a815d620d0:/# netstat -lntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.11:37830        0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:25001           0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5001          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5002          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:49163           0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5003          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5004          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5005          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:49165           0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5006          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5007          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:49167           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5008          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:49169           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:49171           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:49173           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:49175           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:49177           0.0.0.0:*               LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN
udp        0      0 0.0.0.0:58732           0.0.0.0:*
udp        0      0 0.0.0.0:34722           0.0.0.0:*
udp        0      0 0.0.0.0:47431           0.0.0.0:*
udp        0      0 127.0.0.11:56383        0.0.0.0:*
udp        0      0 0.0.0.0:56886           0.0.0.0:*
udp        0      0 0.0.0.0:49162           0.0.0.0:*
udp        0      0 0.0.0.0:49164           0.0.0.0:*
udp        0      0 0.0.0.0:49168           0.0.0.0:*
udp        0      0 0.0.0.0:49172           0.0.0.0:*
udp        0      0 0.0.0.0:49176           0.0.0.0:*

I run rTorrent with scgi_port on 5000.

Flood config.js:

scgi: {
  host: '192.168.99.100',
  port: 5000,
  socket: false,
  socketPath: '/tmp/rtorrent.sock'
}

nginx config:

location /RPC2 {
  include scgi_params;
  scgi_pass 127.0.0.1:5000;
}

I will report the result of netstat -lntu when I am at home tonight.

If I'm right, the nginx location /RPC2 is only used by rutorrent, no ? It looks like rtorrent can open the port 5000 by itself and Flood can connect to rtorrent using that scgi port

You're right I am running diameter/rtorrent-rutorrent. Running netstat -lntu on this docker container outputs this:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:49161           0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN
udp        0      0 0.0.0.0:49160           0.0.0.0:*

Do you have 127.0.0.1 in your .rtorrent.rc? Then you should try this:

scgi_port=0.0.0.0:5000

Don't forget to teplace the port.

Oh yes ! Definitly, replacing scgi_port=127.0.0.1:XXXX into scgi_port=0.0.0.0:XXXX in the .rtorrent.rc file solved the issue.
Thank you @mahoek !

@jfurrow
Here is my proposal:

Dockerfile:

FROM linuxserver/baseimage

# install packages
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash - && \
    apt-get install build-essential git-core libssl-dev nodejs nginx supervisor -qy && \
    npm install -g npm@latest && \
    apt-get clean && \
    rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*

# configure supervisor
COPY supervisord.conf /etc/supervisor/conf.d/

# Load in all of our config files.
COPY nginx.conf /etc/nginx/

# install flood
RUN mkdir /opt/flood && \
    git clone https://github.com/jfurrow/flood /opt/flood && \
    cd /opt/flood && npm install

# add flood configuration using 
COPY config.flood.js /opt/flood/config.js

# expose the reverse proxy
EXPOSE 9000

# expose the reverse proxy
CMD ["supervisord"]

config.flood.js:

const config = {
  dbCleanInterval: 1000 * 60 * 60,
  dbPath: './server/db/',
  floodServerPort: 3000,
  maxHistoryStates: 30,
  pollInterval: 1000 * 5,
  secret: 'flood',
  scgi: {
    host: process.env.RTORRENT_HOSTNAME,
    port: parseInt(process.env.RTORRENT_PORT),
    socket: false,
    socketPath: '/tmp/rtorrent.sock'
  }
};

module.exports = config;

supervisord.conf:

; vim: ft=dosini
[supervisord]
nodaemon = true

[program:flood-node]
priority = 1
directory = /opt/flood
command = npm start
autorestart = true

[program:nginx]
priority = 2
command = nginx -g "daemon off;"
autorestart = true

nginx.conf:

# vim: ft=nginx

user root root;

worker_processes auto;
pid /run/nginx.pid;

events {
    worker_connections 4096;
    use                epoll;
    multi_accept       on;
}

http {
    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include      /etc/nginx/mime.types;
    default_type application/octet-stream;

    access_log /var/log/nginx/access.log combined;
    error_log /var/log/nginx/error.log error;

    gzip         on;
    gzip_disable "msie6";

    server {
        listen 9000 default_server;

        server_name flood;
        root /opt/flood;
        client_max_body_size 5G;

        location / {
            proxy_pass http://localhost:3000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'upgrade';
            proxy_set_header Host $host;
            proxy_cache_bypass $http_upgrade;
        }
    }
}

docker build -t localimages/flood .
My docker compose:

 flood:
   image: localimages/flood
   networks:
    - mynetwork
   container_name: flood
   environment:
    - RTORRENT_HOSTNAME=seedboxdocker_rtorrent_1
    - RTORRENT_PORT=5000

Nice @serut glad you got it working! Your proposal looks really nice. I am definitely going to try it within a couple of days. Thank you! 😄

Btw I see many projects create a separate repo for their Docker, Vagrant, Ansible, Chef, Puppet, etc. to keep the main repository clean.

I was looking around for a torrent client I could get a nice web ui for. I run this on my dockerized server at home so I trew together a couple of containers to link rtorrent and flood. I strongly suggest looking into using alpine as a base as it can achieve ridiculous image sizes

jimlei/alpine-flood          latest        f628d2086cb0        37 minutes ago      234.7 MB
jimlei/alpine-rtorrent       latest        642a40acc95b        40 minutes ago      13.87 MB

I will probably polish these up more in the future though they may or may not be relevant for people not using Rancher to deploy their containers. It has health checks, scaling, load balancing, etc built in. So I don't run a supervisord or Nginx-service, I just have Rancher restart the container if it can't reach the web ui.

screenshot85

screenshot86

@serut @jimlei What do you guys think about this PR? https://github.com/jfurrow/flood/pull/97

I'm not very familiar with containers so I'd appreciate your input.

I'd suggest creating a separate repo for a potential docker setup and just linking to it from floods readme.

I'd also suggest that it's implemented with a multi container setup, preferably using alpine to get small image sizes. That way you retain the clean and "sassy" feel you get from the flood ui. It will also help if you later on decide to support multiple clients, you can then have the same multi container setup - but link in a different client container.

Run only one process per container
In almost all cases, you should only run a single process in a single container. Decoupling applications into multiple containers makes it much easier to scale horizontally and reuse containers. If that service depends on another service, make use of container linking.
https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/

There is a some improvement with the pull request you've made @lafin

  • base the docker image on the lightest image possible, so debian is not good. Even my image takes too much space
localimages/flood    latest    df58fb010681   3 weeks ago    843.8 MB

@jimlei Alpine looks really good ! Thanks for the highlight, I will use it now.

  • .dockerignore is useless : the optimal way to install flood in the image is to wget a zip from the master github branch. Something like that (not tested)
RUN apt-get install -y --no-install-recommends unzip 

[..]

ADD "https://github.com/jfurrow/flood/archive/master.zip" ./
RUN unzip flood-master.zip -d /opt/;  rm /flood-master.zip

Using that way, you do not download the .git and the node_modules folder.

We should consider to add a new way to launch flood than the current start (in package.json), which is :

"start": "npm prune && npm install && ./node_modules/.bin/gulp dist && ./node_modules/.bin/nodemon ./server/bin/www"

into

"preinstall": "npm prune",
"prestart": "./node_modules/.bin/gulp dist",
"start": "./node_modules/.bin/nodemon ./server/bin/www",
"start:production": "node ./dist/server/bin/www", //don't know if it works

When I run flood on production, I want to install only required dependencies and not all dependencies. I would add npm install --production in the dockerfile to just install the strictly required, and developpers have to run npm install from now.

  • no rtorrent.rc in this repository, as @jimlei said, one process per container. A docker-compose would make more sense.

Otherwise, flood is quite stable on my server ! :+1:

$ docker ps
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS
16c2d4a1d5b4        localimages/flood        "supervisord"            3 weeks ago         Up 3 weeks

@serut the worst thing about it is that it gets addictive. Having to run Ubuntu or other large bases feels horrible now :( Other downsides is that it's based on musl libc and packages will need to be ported to alpine before being really usable. This means you will need quite a bit of work to get non supported apps (like plex media server) to run on alpine.

But wow, the container sizes... 4,8MB for a fully working linux container is just, insane. Why is this important? Because if you run multiple services with multiple containers updating can take quite a while if each container is 500-800MB. If you are developing / distributing services using docker then using a smaller image makes using Docker much, much easier.

REPOSITORY                               TAG                 IMAGE ID            CREATED             SIZE
alpine                                   latest              4e38e38c8ce0        7 weeks ago         4.795 MB
alpine                                   3.4                 4e38e38c8ce0        7 weeks ago         4.795 MB
memcached                                alpine              2c2e59023f3c        5 weeks ago         6.248 MB
jimlei/alpine-nano                       latest              48b4e305eaaf        2 weeks ago         7.446 MB
rlesouef/alpine-transmission             latest              f272380a0eac        4 months ago        8.395 MB
jimlei/alpine-rtorrent                   latest              642a40acc95b        41 hours ago        13.87 MB
chamunks/alpine-rtorrent                 latest              29b49fa9d7a8        7 weeks ago         13.89 MB
jwilder/docker-gen                       latest              5b9e037ecadd        2 weeks ago         17.2 MB
jimlei/alpine-nodejs                     latest              d1060bba6a28        5 months ago        24.35 MB
redis                                    alpine              46838178915b        11 days ago         29.67 MB
jimlei/alpine-gulp                       latest              6a7d3e3a00ab        5 months ago        30.83 MB
mhart/alpine-node                        latest              8839e0117bdb        3 weeks ago         47.21 MB
jimlei/alpine-phpcli                     latest              5344cce1b1f1        2 weeks ago         53.03 MB
jrcs/letsencrypt-nginx-proxy-companion   latest              c8e06215e06c        13 days ago         67.09 MB
nginx                                    alpine              5ad9802b809e        7 weeks ago         69.27 MB
jimlei/alpine-composer                   latest              d781b312d059        2 weeks ago         73.2 MB
timhaak/couchpotato                      latest              8d6793688060        40 hours ago        106.1 MB
timhaak/sabnzbd                          latest              2972b8f103cc        2 days ago          117.1 MB
timhaak/sickrage                         latest              ff2394c71464        40 hours ago        150 MB
timhaak/docker-mariadb-alpine            latest              64a1ae08ba12        4 weeks ago         170.2 MB
webhippie/mariadb                        latest              4074d4f70cd4        11 days ago         219.6 MB
jimlei/alpine-flood                      latest              f628d2086cb0        40 hours ago        234.7 MB
wonderfall/nextcloud                     latest              a629b167f263        9 days ago          238.6 MB
jwilder/nginx-proxy                      latest              b9debdc64b60        3 weeks ago         247.7 MB
rancher/agent-instance                   v0.8.3              b6b013f2aa85        8 weeks ago         330.9 MB
jimlei/alpine-netbeans                   latest              abd36779ecc1        5 months ago        416.1 MB
timhaak/plex                             latest              a726ffeec5c2        5 days ago          421.2 MB
rancher/agent                            v1.0.2              860ed2b2e8e3        8 weeks ago         454.3 MB
rancher/convoy-agent                     v0.9.0              0691193de3fa        6 weeks ago         453.7 MB
rancher/server                           latest              ffe9c46b500a        3 weeks ago         842 MB

Imagine how much that plex container stings at 421.2MB... Considering jimlei/alpine-netbeans is a linux container with JVM and the Netbeans IDE installed which weighs in at less...

Thanks for the explanations! I agree that alpine seems like the way to go. Especially since there is a mediainfo package available for it, which I will be adding support for soon.

I created a repo for the Docker setup here: https://github.com/jfurrow/flood-docker Please feel free to open a PR against it and let me know if there is anything I can do to help. In the meantime I need to get my shit together and start using Docker...

@serut I modified the npm scripts here: https://github.com/jfurrow/flood/pull/118

I've made my own here : https://github.com/Wonderfall/dockerfiles/tree/master/rtorrent-flood
It suits my needs but perhaps it can inspire you. My philosophy is "one service per container" rather than "one process per container" (which the official Docker philosophy), that's why I like AIO images. But there's no best choice I think, if you go for a one process container don't forget to provide a docker-compose file.

I like to compile everything from source, so did I with libtorrent and rTorrent. Although Alpine provides them, I don't have to wait the maintainer if an update is available. Look at the mediainfo package, it was not updated since last year. Speaking of mediainfo, I just removed it (I also build it from source) from my image but I will add it again as soon as Flood supports it.

This is a very good image @Wonderfall ! alpine, well designed,... great job !
I think that's a good start for @jfurrow to make the flood-docker with rutorrent separated from flood, with the corresponding docker-compose. ~ 90% of the work is done.

Hi,

I work on my own flood image, unlike @Wonderfall (@Wonderfall made very good images), my image is "one process per container", also based on alpine.
I try to finish for this tonight.
I will provide also the docker-compose.yml.

XataZ,

PS : Sorry for my english,

Edit : My image is available here : https://github.com/xataz/dockerfiles/tree/master/flood

putting my hat in the ring too, i have successfully created a docker image, mine is a little bit more advanced including support for vpn providers (no ip leakage via iptables) and proxy support, as well as rutorrent and flood as 2 possible web interfaces to rtorrent.

https://hub.docker.com/r/binhex/arch-rtorrentvpn/

FWIW, I'm running Flood in Kubernetes using this Docker file:

FROM alpine:latest

RUN apk add --update nodejs make g++ openssl python && \
  rm /var/cache/apk/* && \
  wget https://github.com/jfurrow/flood/archive/master.zip && \
  unzip -q master.zip && \
  rm master.zip

COPY config.js /flood-master/config.js
RUN cd /flood-master && \
  npm install && \
  ./node_modules/.bin/gulp dist

CMD ["sh", "-c", "cd /flood-master; exec /flood-master/server/bin/www"]

and this K8s config:

apiVersion: v1
kind: Service
metadata:
  name: flood
  namespace: media
  labels:
    k8s-app: flood
spec:
  ports:
  - port: 3000
    protocol: TCP
    targetPort: 3000
  selector:
    k8s-app: flood
  type: ClusterIP

---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  labels:
    k8s-app: flood
  name: flood
  namespace: media
spec:
  replicas: 1
  serviceName: "flood"
  template:
    metadata:
      labels:
        k8s-app: flood
    spec:
      containers:
      - image: bluecmd/flood
        imagePullPolicy: Always
        name: flood
        volumeMounts:
          - mountPath: "/flood-db"
            name: flood-db
      restartPolicy: Always
      volumes:
        - name: flood-db
          rbd:
            monitors:
              - ceph-mon.ceph:6789
            user: admin
            image: flood-db
            pool: rbd
            secretRef:
              name: ceph-client-key 

Just updated mine with mediainfo support if you wanna try.
I think it's not necessary to provide an official dockerfile, the community already made a lot of great images for different tastes (for example some will prefer one process per container, other like me prefer an all-in-one container).

I agree, you all have done some awesome work. It's probably best to consolidate these in a wiki article for Flood. If one of you would like to start it, I'd be super grateful, but otherwise I'll get to it ASAP.

Thanks, everyone, for the awesome dockerfiles!

@jfurrow , just a comment on how multi-user works with rutorrent. Have a look at https://github.com/whatbox/ruTorrent/blob/master/conf/config.php. All the user specific data and metadata lives in user's directories (That config shows home, but it can be anywhere, ideally not home). All the paths, and even the unix socket are a function of $user. You can achieve further isolation, by using per-user php-fpm pools. So the php code is running with the same privileges as the user. This has a few benefits. You don't need weird groupings like adding the web server user to the user's group, or leaving directories as 755 in absence of such groupings. The other benefit is that you get better isolation. A compromise only exposes that user's privileges to the attack (as opposed to the webserver's priveleges). These privileges can also be further limited with something like selinux. If you implement a multi-user solution, please test it on a restrictive environment with selinux enabled.

Is there a docker image for flood? #79 ==> Now there is https://github.com/jfurrow/flood/pull/304 & https://github.com/jfurrow/flood/pull/370

May be we can close this issue? Still possible to open a new one if problem with the docker container.

The initial question was Is there a docker image for flood?.
So the answer is yes now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

runaroundhome picture runaroundhome  Â·  6Comments

rarescosma picture rarescosma  Â·  3Comments

geopsllc picture geopsllc  Â·  5Comments

Phr33d0m picture Phr33d0m  Â·  6Comments

randomnonsense picture randomnonsense  Â·  5Comments