Flood-UI / flood

A web UI for rTorrent, qBittorrent and Transmission with a Node.js backend and React frontend. Migrate to v4: https://github.com/jesec/flood/wiki/Migrate-from-older-versions-of-Flood.
https://flood.js.org
GNU General Public License v3.0
1.82k stars 173 forks source link

Create a docker hub automated build #448

Closed penx closed 5 years ago

penx commented 7 years ago

I've created one here, but it's pointed at a fork, think a project admin would need to set this up so it rebuilds on every commit:

https://hub.docker.com/r/penx/flood/

jfurrow commented 7 years ago

Okay, I've finally realized why Docker containers are good (more or less), and I want to recommend that Flood users run Flood in a Docker container. But I don't know where to start, exactly, or what the etiquette is.

I've been using @Wonderfall's Dockerfile for development, which contains both rTorrent and Flood, and it's working well for me. Is this good practice?

I'll read more of the docs...

0xcaff commented 6 years ago

@jfurrow, You can start by following the directions provided by @penx or the tutorial in the docker docs. Once this is done, users can run flood with:

docker run -e RTORRENT_SCGI_HOST=w.x.y.z -p 3000:3000 jfurrow/flood

This is nice because users don't have to build anything locally.

The convention is to generate a docker container for each service (one for rtorrent, one for flood) and connect them together at runtime using something like docker-compose.

I just created a minimal container for rtorrent for linking to this when it is ready.

noraj commented 6 years ago

rTorrent and flood must not be in the same container. A container for each is a good practice. Because you can reuse the same rTorrent container for ruTorrent for example.

deed02392 commented 6 years ago

I concur with @noraj1337, I would be happy with a straight up automated build of this repo which is exactly what you'll achieve if you follow the suggestions verbatim.

I have written an AWS lambda script to automatically trigger new Docker Hub builds of release tags for another GitHub repo I'm not the owner of. I could use that for this repo for now if anyone is interested. This would address that out of date issue your fork will create, @penx.

noraj commented 6 years ago

@deed02392

Why it is recommended to run only one process in a container?

But thanks to Docker compose you will be able to build a multi-container Docker applications. So just build a flood alone container + a config file for docker compose where you tell to pull the flood container + an already existing rTorrent container. This will be as easy for you to build if not even easier, it will be as automatic and as easy to deploy.

deed02392 commented 6 years ago

@noraj1337 even easier than what? I was agreeing with you .

0xcaff commented 6 years ago

I believe there was someone else in this conversation who deleted their comments.

noraj commented 6 years ago

@deed02392 My bad if I misunderstood, I'm not a native english speaker.

cron410 commented 6 years ago

I can assist with this. I actually have one set up already since I do not have access to your github account. I did it the hard way by creating a 1:1 fork on my github with backstroke to automate pull requests. https://hub.docker.com/r/themetabay/flood/

What you want to do is set up a docker hub account, connect your github account with this page: https://hub.docker.com/account/authorized-services/ then use the menu on the top right to create an Automated Build here: https://hub.docker.com/add/automated-build/jfurrow/ and point it at the docker-flood github repo.

codevski commented 6 years ago

+1 this would be awesome to have.

penx commented 5 years ago

@jfurrow any chance you could do this? Hopefully the 5 steps in my original ticket should only take you 5 minutes - let me know if not, or you have any questions. Happy to help, but as mentioned you need to be an admin of this repo to set this up.

deed02392 commented 5 years ago

Happy to jump on a phone call with you too @jfurrow if need be

noraj commented 5 years ago

@deed02392 maybe catch him on discord

Sparticuz commented 5 years ago

Any movement on this?

cron410 commented 5 years ago

I would recommend my repo, but it seems backstroke has stopped sending pull requests to my 1:1 copy of this repo.

noraj commented 5 years ago

Pushing docker images on dockerhub automatically must be done with git/release tags with is a problem since flood has only 1 version right now. See this point no versioning (only 1 release) from #712 and this issue Make a new github release, the current release is quite old. #734

gytis-ivaskevicius commented 5 years ago

Webhook could be set up on any new commits to the master branch. Wouldn't doing it this way solve point no versioning (only 1 release)

noraj commented 5 years ago

@WithoutCaps true but I don't see it as a good idea, because the master branch may be unstable but there can be a release docker image and a git based docker image.

SerialVelocity commented 5 years ago

@noraj Having an unstable build is quite a bit better than nothing. Best option would ofc be start tagging releases every so often just so people know whether there are large features/improvements/bugfixes in the next release they take and can upgrade accordingly but that does put more load on @jfurrow.

If the tag is called develop instead of latest it may help inform people that it may break suddenly.

Currently, people just pull a random docker image from dockerhub which is just a random commit of flood...

deed02392 commented 5 years ago

@jfurrow for comment

noraj commented 5 years ago

Anyway @jfurrow used to spend like 1/2 every 3 months on the project those last years so better create the automated build (CI files and all) for him and make a PR so he have only to merge it and open a docker hub account else I don't think it will happen.

jfurrow commented 5 years ago

so better create the automated build (CI files and all) for him and make a PR so he have only to merge it and open a docker hub account

This is spot-on! Y'all should submit a PR with what you want.

noraj commented 5 years ago

What I was trying to say is : "Don't wait for the feature to come if you don't plan to dev it yourself".

penx commented 5 years ago

This is spot-on! Y'all should submit a PR with what you want.

This ticket doesn’t require any dev work else I would have done it a couple of years ago when I raised it.

It requires 5 minutes of @jfurrow’s time to follow the steps in my original ticket.

Unfortunately only @jfurrow can do this as setup requires admin access to the repo, as per my previous comment.

penx commented 5 years ago

Pushing docker images on dockerhub automatically must be done with git/release tags

This certainly wasn’t the case when I opened this ticket 2 years ago. I was able to set this up on a fork just fine

jfurrow commented 5 years ago

Ahh I see...

cron410 commented 5 years ago

@jfurrow the steps have changed since last year, but you would still only have to do this once. I see you already have an account. First hurdle over.

Step 1: Go here: https://cloud.docker.com/settings/#container-source-providers click Connect or click Re-link if the Connect button is missing. image

Step 2: Go here: https://cloud.docker.com/repository/create Name it, scroll down and click the Github icon, make selections in the 2 dropdowns. Click Create and Build image

Done. That's it. Then you would be able to close this issue.

jfurrow commented 5 years ago

Thanks @cron410! I'm pretty sure I created the docker build at https://cloud.docker.com/repository/registry-1.docker.io/jfurrow/flood-ui... could you verify before I close this issue?

SerialVelocity commented 5 years ago

The link to your docker image is here: https://hub.docker.com/r/jfurrow/flood-ui

It's visible and was successfullly built but I haven't tested it.

Sparticuz commented 5 years ago

It looks like that container is working. The only thing I changed in my docker compose file was switching out this line build: https://github.com/Flood-UI/flood.git with image: jfurrow/flood-ui

However, because I use FLOOD_BASE_URI, each time I update the container I need to run the following code to recompile flood's static assets.

docker exec flood_container npm install
docker exec flood_container npm audit fix
docker exec flood_container npm run build
docker exec flood_container npm prune --production
docker restart flood_container

This might be it's own issue, but I see two solutions to automate this.

noraj commented 5 years ago

@Sparticuz maybe it is possible to automate this with docker compose.

cron410 commented 5 years ago

@jfurrow since @Sparticuz tested, the automated build is working. No further action is necessary as all future changes will be made here on Github by changes to the Dockerfile. I think we can close this one out.

jfurrow commented 5 years ago

Thanks!