-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Docker deployment support #588
Docker deployment support #588
Conversation
grunt-contrib-imagemin seems to be broken because several dependencies are quite obsolete and cannot be downloaded.
Signed-off-by: John Wu <webmaster@leapoahead.com>
Signed-off-by: John Wu <webmaster@leapoahead.com>
Signed-off-by: John Wu <webmaster@leapoahead.com>
@@ -0,0 +1,25 @@ | |||
FROM debian:wheezy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to use Debian and not Ubuntu as the base image?
Thanks, @tjwudi ! This is much appreciated (and long awaited). I've left some comments. |
Signed-off-by: John Wu <webmaster@leapoahead.com>
Instead of binding to `0.0.0.0`, use `127.0.0.1` instead for security concerns. "The Python Web server is more vulnerable than nginx that proxies it." Signed-off-by: John Wu <webmaster@leapoahead.com>
Signed-off-by: John Wu <webmaster@leapoahead.com>
Signed-off-by: John Wu <webmaster@leapoahead.com>
Signed-off-by: John Wu <webmaster@leapoahead.com>
Also, @arikfr is it a good practice to use db containers? Since files modified will be discarded when container stops, then all data will be lost if we do not commit the container regularly. |
By using Dockerfile `RUN` command, we can enable docker to cache our build. Also, much more easier to maintain. Signed-off-by: John Wu <webmaster@leapoahead.com>
Updated! |
@tjwudi that's what data volumes are for: https://docs.docker.com/userguide/dockervolumes/ |
ENV FILES_BASE_URL /opt/redash/current/setup/files/ | ||
|
||
# Base packages | ||
RUN apt-get dist-upgrade |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is probably not needed. I had some issues with AWS Ubuntu images, and added it. But normally everything should work fine without it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which line is it? GitHub didn't point out which one exactly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUN apt-get dist-upgrade
@arikfr then probably add data volumes in docker-compose-example.yaml? |
FYI below is the docker-compose.yml file I've been using with success. Some notes on differences:
|
I played with re:dash a bit and decided that it's nice to split celery and web into separate containers. It's easier to run on marathon and scale this way and you don't have to mess with init systems. |
So I decided to create a separate image for redash nginx. It's now live on https://hub.docker.com/r/tjwudi/redash-nginx/ and repo https://github.com/tjwudi/redash-nginx. |
Signed-off-by: John Wu <webmaster@leapoahead.com>
Signed-off-by: John Wu <webmaster@leapoahead.com>
Signed-off-by: John Wu <webmaster@leapoahead.com>
Why not keep the Dockerfile and nginx.conf for the nginx image in this Also make sure to add daemon off directive to nginx.conf.
|
@arikfr Also makes sense. Though I prefer one image one repo, I can do it if that is what you guys want :) |
@arikfr daemon is off by default |
Signed-off-by: John Wu <webmaster@leapoahead.com>
Well the thing is, the latest build does not contain supervisord_docker.conf so it can fail if you try to build. Anyway, it is now downloading from latest build instead :) |
Signed-off-by: John Wu <webmaster@leapoahead.com>
@bobrik Separating celery is definitely what we want to do next, but probably in another branch maybe? b/c I don't know the complexity to do it yet. |
I agree that we can split the images in another iteration/branch. Also the resulting image can still be used without the supervisord with custom run command. |
error_log /var/log/nginx/log/error.log; | ||
|
||
location / { | ||
proxy_pass http://redashapp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless in newer versions of nginx those options are on by default worth adding to the server directive:
gzip on;
gzip_types *;
gzip_proxied any;
and to the location /
directive:
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
Signed-off-by: John Wu <webmaster@leapoahead.com>
FROM ubuntu:trusty | ||
MAINTAINER Di Wu <diwu@yelp.com> | ||
|
||
ENV FILES_BASE_URL /opt/redash/current/setup/files/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is no longer used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed :)
Signed-off-by: John Wu <webmaster@leapoahead.com>
|
Merged. I will probably tweak it some more myself, to make it work with CI and everything. Thanks a lot for the effort making this and patience during the review. :-) 👍 |
My pleasure. Learned a lot here. Will go on contributing :) @arikfr ++ |
Awesome 👍 |
@arikfr are you working on separating celery tasks? If not, I am happy to take over. |
@tjwudi you mean having Celery and gunicorn in separate containers? |
Add docker support (see #450).
Couple things to note:
0.0.0.0
instead of only127.0.0.1
. So docker containers can accept incoming traffic then.