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

commented Sep 26, 2018

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
Owner

left a comment

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 && \

This comment has been minimized.

Copy link
@omarroth

omarroth Sep 26, 2018

Owner

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.

This comment has been minimized.

Copy link
@flourgaz

flourgaz Sep 28, 2018

Author Contributor

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 flourgaz force-pushed the flourgaz:feature/docker-compose branch from e8eb0e6 to 020ba71 Sep 28, 2018
@flourgaz

This comment has been minimized.

Copy link
Contributor Author

commented Sep 28, 2018

the issue with imagemagick / rsvg is still TODO

@omarroth

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor Author

commented Sep 29, 2018

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 flourgaz force-pushed the flourgaz:feature/docker-compose branch from 020ba71 to 71a9954 Sep 29, 2018
@flourgaz

This comment has been minimized.

Copy link
Contributor Author

commented Sep 29, 2018

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

This comment has been minimized.

Copy link
Owner

commented Sep 29, 2018

LGTM 👍

@omarroth omarroth merged commit 1de7c0c into omarroth:master Sep 29, 2018
@omarroth

This comment has been minimized.

Copy link
Owner

commented Sep 29, 2018

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

@flourgaz flourgaz deleted the flourgaz:feature/docker-compose branch Oct 1, 2018
@flourgaz

This comment has been minimized.

Copy link
Contributor Author

commented Oct 1, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.