{"action":"created","issue":{"url":"https://api.github.com/repos/SaminOz/redis-random-data-generator/issues/6","repository_url":"https://api.github.com/repos/SaminOz/redis-random-data-generator","labels_url":"https://api.github.com/repos/SaminOz/redis-random-data-generator/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/SaminOz/redis-random-data-generator/issues/6/comments","events_url":"https://api.github.com/repos/SaminOz/redis-random-data-generator/issues/6/events","html_url":"https://github.com/SaminOz/redis-random-data-generator/pull/6","id":199904428,"number":6,"title":"Add Docker support","user":{"login":"pataquets","id":1286254,"avatar_url":"https://avatars3.githubusercontent.com/u/1286254?v=4","gravatar_id":"","url":"https://api.github.com/users/pataquets","html_url":"https://github.com/pataquets","followers_url":"https://api.github.com/users/pataquets/followers","following_url":"https://api.github.com/users/pataquets/following{/other_user}","gists_url":"https://api.github.com/users/pataquets/gists{/gist_id}","starred_url":"https://api.github.com/users/pataquets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pataquets/subscriptions","organizations_url":"https://api.github.com/users/pataquets/orgs","repos_url":"https://api.github.com/users/pataquets/repos","events_url":"https://api.github.com/users/pataquets/events{/privacy}","received_events_url":"https://api.github.com/users/pataquets/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-10T18:57:19Z","updated_at":"2017-08-07T20:17:12Z","closed_at":"2017-07-05T14:17:39Z","pull_request":{"url":"https://api.github.com/repos/SaminOz/redis-random-data-generator/pulls/6","html_url":"https://github.com/SaminOz/redis-random-data-generator/pull/6","diff_url":"https://github.com/SaminOz/redis-random-data-generator/pull/6.diff","patch_url":"https://github.com/SaminOz/redis-random-data-generator/pull/6.patch"},"body":"Add Dockerfile to enable image building. Using the official nodejs image. More info at https://hub.docker.com/_/node/\r\nAllowed me to work on this software without any NodeJS setup on my Linux dev box.\r\n\r\nSince it's not possible to specify the target Redis server other than config file (eg, command-line or env var), I've resorted to replace ```127.0.0.1``` by ```redis``` as the default Redis server in the included config file for the image, since neither ```localhost``` nor ```127.0.0.1``` would work from inside a container.\r\n\r\nAs of now, you can either:\r\n* Link yourself the Docker container to an existing Redis instance via ```--link``` or ```--add-host``` at container launch (linked hostname should be ```redis```)\r\n* Mount an existing ```config.json``` file from the Docker host via ```-v``` option\r\n(Using linked container as demo method below)\r\n\r\nBuild:\r\n\r\n```\r\n$ docker build -t redis-random-data-generator .\r\n```\r\n\r\nRun a Redis server to use it later for testing (exposing Redis port ```-p``` is not required):\r\n\r\n```\r\n$ docker run --rm -it --name redis [ -p 6379:6379 ] redis:3 redis-server --save \"\" --maxmemory 1gb\r\n```\r\n\r\nFrom another terminal, launch a container from the above built image:\r\n\r\n```\r\ndocker run --rm -it --link redis:redis redis-random-data-generator [ options... ]\r\n```\r\n\r\nFYI, there's a still quicker to test, already built image on my Docker Hub. Test it by running:\r\n\r\n```\r\n$ docker run --rm -it --link redis:redis pataquets/redis-random-data-generator [ options... ]\r\n```\r\n\r\nNotice I'm using the `--rm` (remove container on finish) and interactive mode (`-it`) Docker launch flags. Stop containers by `CTRL+C`'ing them.\r\n\r\nOptional improvement to come:\r\n- Create an 'official', based on your repo, automated build at Docker Hub for the image: https://docs.docker.com/docker-hub/builds/ . Just requires a free Docker Hub account and a following a quick 'Create automated build' process."},"comment":{"url":"https://api.github.com/repos/SaminOz/redis-random-data-generator/issues/comments/320768887","html_url":"https://github.com/SaminOz/redis-random-data-generator/pull/6#issuecomment-320768887","issue_url":"https://api.github.com/repos/SaminOz/redis-random-data-generator/issues/6","id":320768887,"user":{"login":"pataquets","id":1286254,"avatar_url":"https://avatars3.githubusercontent.com/u/1286254?v=4","gravatar_id":"","url":"https://api.github.com/users/pataquets","html_url":"https://github.com/pataquets","followers_url":"https://api.github.com/users/pataquets/followers","following_url":"https://api.github.com/users/pataquets/following{/other_user}","gists_url":"https://api.github.com/users/pataquets/gists{/gist_id}","starred_url":"https://api.github.com/users/pataquets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pataquets/subscriptions","organizations_url":"https://api.github.com/users/pataquets/orgs","repos_url":"https://api.github.com/users/pataquets/repos","events_url":"https://api.github.com/users/pataquets/events{/privacy}","received_events_url":"https://api.github.com/users/pataquets/received_events","type":"User","site_admin":false},"created_at":"2017-08-07T20:17:12Z","updated_at":"2017-08-07T20:17:12Z","body":"@SaminOz ping?"}}
{"actor":{"display_login":"pataquets"}}