Repository: getredash/redash

Issue:
docker support
It would be nice to have Dockerfile in repo, so we can build a container automatically



Discussion:
It is in the backlog. Can't commit to ETA, but I will comment here when it's available.

@arikfr @saritasa I plan on working on it next week.

Is anybody still working on this? I am currently investigating to add a Dockerfile to redash too. I would like to follow up if anybody have made a working version ;)

@tjwudi I was planning on this but got drawn to other project internally.

I don't have a working version yet, but it's definitely something I am planning on doing since we are dockerizing a lot of the infrastructure right now and redash is becoming a major part of our admin interfaces.

@KensoDev thanks for your info. Then I will start to work on it. Once I got it working I will send in a PR.

I'm adding some thoughts on how to add Docker support for re:dash, in case someone would like to pick up the glove :)

Basically the whole setup process is "documented" in the [bootstrap script](https://github.com/EverythingMe/redash/blob/master/setup/bootstrap.sh), but the Docker setup should only take inspiration from it rather reuse it entirely.

Basically what I would do is:
1. Use PostgreSQL official container.
2. Use Redis official container.
3. Use Nginx official container.
4. Create "base" re:dash container, which will be used for the workers and web server.
5. Move the [database bootstrap](https://github.com/EverythingMe/redash/blob/master/setup/bootstrap.sh#L143-L151) part into a script in the `bin` folder.

Then tie everything together with Docker compose and some setup script to create the database once everything is up. Basic re:dash setup should have the following containers: PostgreSQL, Redis, Nginx, re:dash web server, re:dash "master" celery worker (with --beat option) & one additional re:dash celery worker.

I'm quite new to Docker, so if someone has other suggestions, I'll be happy to hear.

@arikfr Oh you use nginx in a separate container? Is there any reason not use nginx in the same container with redash?

@tjwudi That's a Docker best practice, but you need to understand what is _your_ purpose of doing this.
If the purpose it to make redash easily distributed across machines, uses @arikfr suggestion.

This way, you can compose the workload easier and not worry about processes running inside Docker, each Docker will be a process that you can monitor using upstart or anything like that.

I'm not using re:dash with Docker yet, the above outline was just a suggestion. As for reasoning, @KensoDev summed it up nicely. But I will add that it's not only about distributing across machines (which not really relevant for re:dash) but more about reusing existing work (in this case - official nginx container) and following best practices.

@arikfr yes.

Also, when you have a single point of entry to a docker machine there's less complexity when you run it and monitor it.

This way, you upstart a docker and the entry point is nginx, another is celery etc...

Proper docker support would be nice. I did get re:dash running in docker via the naive method of running the provision script on top of a basic ubuntu instance (actually wget libffi-dev need to be installed before the provision script will run as it is - also I had to add a 'service postgresql start' in the middle of the script, otherwise it didn't see the database at all). So... it is possible to do anyway. But following docker best practices would be nice.

Docker support now in master from #588 

I will build "official" images later this week. But whoever wants, can use the Dockerfile directly.


Resolving patch:
diff --git a/bin/release_manager.py b/bin/release_manager.py
--- a/bin/release_manager.py
+++ b/bin/release_manager.py
@@ -7,7 +7,7 @@
 
 github_token = os.environ['GITHUB_TOKEN']
 auth = (github_token, 'x-oauth-basic')
-repo = 'EverythingMe/redash'
+repo = 'getredash/redash'
 
 def _github_request(method, path, params=None, headers={}):
     if not path.startswith('https://api.github.com'):
diff --git a/setup/latest_release_url.py b/setup/latest_release_url.py
deleted file mode 100644
--- a/setup/latest_release_url.py
+++ /dev/null
@@ -1,6 +0,0 @@
-import urllib2
-import json
-
-latest = json.load(urllib2.urlopen("https://api.github.com/repos/EverythingMe/redash/releases/latest"))
-
-print latest['assets'][0]['browser_download_url']


Test patch:
diff --git a/tests/query_runner/test_mongodb.py b/tests/query_runner/test_mongodb.py
--- a/tests/query_runner/test_mongodb.py
+++ b/tests/query_runner/test_mongodb.py
@@ -52,7 +52,7 @@ def test_parses_isodate_in_nested_fields(self):
         self.assertEqual(query_data['test_dict']['b']['date'], datetime.datetime(2014, 10, 4, 0, 0))
 
     def test_handles_nested_fields(self):
-        # https://github.com/EverythingMe/redash/issues/597
+        # https://github.com/getredash/redash/issues/597
         query = {
             "collection": "bus",
             "aggregate": [