Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic docker-compose cluster #186

Merged
merged 1 commit into from
Sep 29, 2018

Conversation

flourgaz
Copy link
Contributor

Run docker-compose up in the base directory of the project, it should build two images and start two containers, one for the app, other for postgres db.

Find the IP of the app container with docker inspect invidious_invidious_1 | grep IPAddress and access that IP address with port 3000 in your browser.

To rebuild the images (after changing anything in the code/dockerfile) run docker-compose build or docker-compose build --no-cache.

The postgres data is in stored in a volume which is set up on first run. If you want to delete that and setup again, remove the volume with docker volume rm invidious_postgresdata (the name might be slightly different if you have the project in different directory, find it with docker volume ls.

Copy link
Contributor

@omarroth omarroth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, I left a couple notes.

@@ -0,0 +1,17 @@
FROM ubuntu:bionic

RUN apt-get update && apt-get install -y git curl imagemagick librsvg2-bin gnupg && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the clock CAPTCHA looks like this:
download
Which I suspect is due to missing dependencies for imagemagick, but I'm having trouble tracking it down. I've tried using librsvg2-dev instead, unfortunately still encountering it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was playing around with the dependencies and extras for imagemagick, but nothing worked, until I tried building it from ubuntu:xenial, but I'm hesitant to go that far back. I'll try to check what's changed between xenial imagemagick and the current bionic

docker/Dockerfile Outdated Show resolved Hide resolved
setup.sh Outdated Show resolved Hide resolved
@flourgaz
Copy link
Contributor Author

the issue with imagemagick / rsvg is still TODO

@omarroth
Copy link
Contributor

omarroth commented Sep 28, 2018

The solution you mentioned with imagemagick actually reminded me that I encountered the same issue when attempting to setup Invidious on DigitalOcean. Using Bionic, I tried building from source, using imagemagick 6.9, installing various other libraries, and ended up using Xenial rather than investigate further.

For reference, here are two different machines that render the CAPTCHA as expected:

$ uname -srm
Linux 4.4.0-134-generic x86_64

$ convert -version
convert -version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2018-07-10 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib
$ uname -srm
Linux 4.18.9-arch1-1-ARCH x86_64

$ convert -version
Version: ImageMagick 7.0.8-12 Q16 x86_64 2018-09-23 https://imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenCL OpenMP 
Delegates (built-in): bzlib cairo fontconfig freetype gslib heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png ps raw rsvg tiff webp wmf x xml zlib

@flourgaz
Copy link
Contributor Author

flourgaz commented Sep 29, 2018

yes, I'm pretty sure it's because of the "rsvg" mentioned among the delegates, because the docker bionic version doesn't have it, but the xenial does. Unfortunately I haven't found any other means of getting it there, than compiling imagemagick from sources with a --with-rsvg parameter during the configuration. It seems like the bionic version of the package simply doesn't come with it. I could compile it, but I really wish I wouldn't have to. As far as I read in the tutorials, the build deps are 500MB+

@flourgaz
Copy link
Contributor Author

Ok, I just found that the artful and bionic versions of imagemagick are explicitly built with --without-rsvg. But the arch linux package still has it. And this is the beauty of docker, I'll simply swap the base image and build it on arch linux ;-)

@flourgaz
Copy link
Contributor Author

finally got it working on arch, there are couple of basic packages needed for the build and clock needed a font, but it works fine now. And I bound the port to localhost:3000 so now you don't need to look for the IPAddress of the container

@omarroth
Copy link
Contributor

LGTM 👍

@omarroth omarroth merged commit 1de7c0c into iv-org:master Sep 29, 2018
@omarroth
Copy link
Contributor

Added instructions in the README, let me know if anything should be changed here or in a new PR.

@flourgaz flourgaz deleted the feature/docker-compose branch October 1, 2018 07:16
@flourgaz
Copy link
Contributor Author

flourgaz commented Oct 1, 2018

Looks great.
Next step - production docker image automatically built on hub.docker.com. I'll look into it...

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants