{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/sti-nodejs/pulls/comments/47271099","id":47271099,"diff_hunk":"@@ -90,18 +90,52 @@ file inside your source code repository.\n \n Example: DATABASE_USER=sampleUser\n \n-Hot deploy\n+Development Mode\n ---------------------\n-Hot deploy is not supported in this image. To support it, make sure that modules responsible for the server reload are installed upon the build process. Those modules are:\n+This image supports development mode. This mode can be switched on and off with the environment variable `DEV_MODE`. `DEV_MODE` can either be set to `true` or `false`.\n+Development mode supports two features:\n+* Hot Deploy\n+* Debugging\n+\n+The debug port can be speicifed with the environment variable `DEBUG_PORT`. `DEBUG_PORT` is only valid if `DEV_MODE=true`.\n+\n+A simple example command for running the docker container in production mode is:\n+```\n+docker run --env DEV_MODE=true my-image-id\n+```\n+\n+To run the container in development mode with a debug port of 5454, run:\n+```\n+$ docker run --env DEV_MODE=true DEBUG_PORT=5454 my-image-id\n+```\n+\n+To run the container in production mode, run:\n+```\n+$ docker run --env DEV_MODE=false my-image-id\n+```\n+\n+By default, `DEV_MODE` is set to `true`, and `DEBUG_PORT` is set to `5858`.\n+\n+Hot deploy\n+--------------------\n \n-* [Supervisor](https://github.com/petruisfan/node-supervisor)\n-* [Nodemon](https://github.com/remy/nodemon)\n+As part of development mode, this image supports hot deploy. If development mode is enabled, any souce code that is changed in the running container will be immediately reflected in the running nodejs application.\n \n-Please note that in order to be able to run your application in development mode, you need to modify the [S2I run script](https://github.com/openshift/source-to-image#anatomy-of-a-builder-image), so the web server is launched by the chosen module, which checks for changes in the source code.\n+### Using Docker's exec\n \n-To change your source code in running container, use Docker's [exec](http://docker.io) command:\n+To change your source code in a running container, use Docker's [exec](http://docker.io) command:\n ```\n-docker exec -it <CONTAINER_ID> /bin/bash\n+$ docker exec -it <CONTAINER_ID> /bin/bash\n ```\n \n-After you [Docker exec](http://docker.io) into the running container, your current directory is set to `/opt/app-root/src`, where the source code is located.\n+After you [Docker exec](http://docker.io) into the running container, your current directory is set to `/opt/app-root/src`, where the source code for your application is located.\n+\n+### Using OpenShift's rsync\n+\n+If you have deployed the container to OpenShift, you can use [oc rsync](https://docs.openshift.org/latest/dev_guide/copy_files_to_container.html) to copy local files to a remote container running in an OpenShift pod. Examples of integrating this behaviour with Grunt and Gulp's _watch_ tasks can be found [here](./test/test-app).\n+\n+#### Warning:\n+Hot deploy is implemented with the default behaviour of [nodemon](https://github.com/remy/nodemon). The default behaviour is to execute the main attribute of the _package.json_ file, and failing that, to execute the start script. In production mode, sti-nodejs will execute the start script via `npm start -d`. It is advised to remove the _main_ attribute in the _package.json_ file when using hot deploy/development mode.","path":"0.10/README.md","position":57,"original_position":57,"commit_id":"be7697e6471b31e2220f8288d4e8c2371fbd785f","original_commit_id":"be7697e6471b31e2220f8288d4e8c2371fbd785f","user":{"login":"bparees","id":4974046,"avatar_url":"https://avatars.githubusercontent.com/u/4974046?v=3","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false},"body":"got it. thanks for the detailed explanation, this would definitely be good info to have in the docs.\r\n","created_at":"2015-12-10T19:19:37Z","updated_at":"2015-12-10T19:19:37Z","html_url":"https://github.com/openshift/sti-nodejs/pull/77#discussion_r47271099","pull_request_url":"https://api.github.com/repos/openshift/sti-nodejs/pulls/77","_links":{"self":{"href":"https://api.github.com/repos/openshift/sti-nodejs/pulls/comments/47271099"},"html":{"href":"https://github.com/openshift/sti-nodejs/pull/77#discussion_r47271099"},"pull_request":{"href":"https://api.github.com/repos/openshift/sti-nodejs/pulls/77"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/sti-nodejs/pulls/77","id":53298969,"html_url":"https://github.com/openshift/sti-nodejs/pull/77","diff_url":"https://github.com/openshift/sti-nodejs/pull/77.diff","patch_url":"https://github.com/openshift/sti-nodejs/pull/77.patch","issue_url":"https://api.github.com/repos/openshift/sti-nodejs/issues/77","number":77,"state":"open","locked":false,"title":"Add development mode for nodejs image","user":{"login":"Ian-Stewart-Binks","id":6301000,"avatar_url":"https://avatars.githubusercontent.com/u/6301000?v=3","gravatar_id":"","url":"https://api.github.com/users/Ian-Stewart-Binks","html_url":"https://github.com/Ian-Stewart-Binks","followers_url":"https://api.github.com/users/Ian-Stewart-Binks/followers","following_url":"https://api.github.com/users/Ian-Stewart-Binks/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Stewart-Binks/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Stewart-Binks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Stewart-Binks/subscriptions","organizations_url":"https://api.github.com/users/Ian-Stewart-Binks/orgs","repos_url":"https://api.github.com/users/Ian-Stewart-Binks/repos","events_url":"https://api.github.com/users/Ian-Stewart-Binks/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Stewart-Binks/received_events","type":"User","site_admin":false},"body":"This pull request adds in a _development mode_ to the sti-nodejs docker image as per [this developer experience JIRA issue](https://issues.jboss.org/browse/DEVEX-43).\r\n\r\n### \"Hot Deploy\"\r\n_Development mode_ enables developers to run their applications using [nodemon](https://github.com/remy/nodemon) to help emulate hot-deploy and lets users specify the debug port upon running their docker image. Development mode should help guide future developer tooling, as well.\r\n\r\n### Environment Variables/Developer Tooling Labels\r\nThis PR adds two new environment variables, `DEV_MODE` and `DEBUG_PORT` which are also added to the labels of the STI docker image, as per [this JIRA issue](https://issues.jboss.org/browse/CLOUD-243) (`com.redhat.dev-mode`, `com.redhat.dev-mode.port`) . The app's deployment directory is also a new label on the image, but has no corresponding environment variable (`com.redhat.deployments-dir`).\r\n\r\n### A Note on Testing\r\nThe tests for this PR cover default environment variable setting, and ensure that the environment variables that are set match the environment variables that are specified in the corresponding `com.redhat.*` labels.\r\n\r\n### Grunt/Gulp Integration With `oc rsync`/`watch`\r\nThe PR also adds in a _Gruntfile.js_ and a _gulpfile.js_, and documentation on how to use these command line tools to automatically sync their local source code to the code that's running in a remote container hosted on OpenShift.\r\n\r\nIf you have any further questions, please do not hesitate to ask.","created_at":"2015-12-10T18:42:38Z","updated_at":"2015-12-10T19:19:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"239a9c9ae993da4b6c2c1ad0f98c022831aaa70b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/sti-nodejs/pulls/77/commits","review_comments_url":"https://api.github.com/repos/openshift/sti-nodejs/pulls/77/comments","review_comment_url":"https://api.github.com/repos/openshift/sti-nodejs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/sti-nodejs/issues/77/comments","statuses_url":"https://api.github.com/repos/openshift/sti-nodejs/statuses/be7697e6471b31e2220f8288d4e8c2371fbd785f","head":{"label":"Ian-Stewart-Binks:dev-mode","ref":"dev-mode","sha":"be7697e6471b31e2220f8288d4e8c2371fbd785f","user":{"login":"Ian-Stewart-Binks","id":6301000,"avatar_url":"https://avatars.githubusercontent.com/u/6301000?v=3","gravatar_id":"","url":"https://api.github.com/users/Ian-Stewart-Binks","html_url":"https://github.com/Ian-Stewart-Binks","followers_url":"https://api.github.com/users/Ian-Stewart-Binks/followers","following_url":"https://api.github.com/users/Ian-Stewart-Binks/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Stewart-Binks/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Stewart-Binks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Stewart-Binks/subscriptions","organizations_url":"https://api.github.com/users/Ian-Stewart-Binks/orgs","repos_url":"https://api.github.com/users/Ian-Stewart-Binks/repos","events_url":"https://api.github.com/users/Ian-Stewart-Binks/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Stewart-Binks/received_events","type":"User","site_admin":false},"repo":{"id":45553250,"name":"sti-nodejs","full_name":"Ian-Stewart-Binks/sti-nodejs","owner":{"login":"Ian-Stewart-Binks","id":6301000,"avatar_url":"https://avatars.githubusercontent.com/u/6301000?v=3","gravatar_id":"","url":"https://api.github.com/users/Ian-Stewart-Binks","html_url":"https://github.com/Ian-Stewart-Binks","followers_url":"https://api.github.com/users/Ian-Stewart-Binks/followers","following_url":"https://api.github.com/users/Ian-Stewart-Binks/following{/other_user}","gists_url":"https://api.github.com/users/Ian-Stewart-Binks/gists{/gist_id}","starred_url":"https://api.github.com/users/Ian-Stewart-Binks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ian-Stewart-Binks/subscriptions","organizations_url":"https://api.github.com/users/Ian-Stewart-Binks/orgs","repos_url":"https://api.github.com/users/Ian-Stewart-Binks/repos","events_url":"https://api.github.com/users/Ian-Stewart-Binks/events{/privacy}","received_events_url":"https://api.github.com/users/Ian-Stewart-Binks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ian-Stewart-Binks/sti-nodejs","description":"","fork":true,"url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs","forks_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/forks","keys_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/teams","hooks_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/hooks","issue_events_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/events","assignees_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/tags","blobs_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/languages","stargazers_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/stargazers","contributors_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/contributors","subscribers_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/subscribers","subscription_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/subscription","commits_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/merges","archive_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/downloads","issues_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/labels{/name}","releases_url":"https://api.github.com/repos/Ian-Stewart-Binks/sti-nodejs/releases{/id}","created_at":"2015-11-04T16:50:45Z","updated_at":"2015-11-04T16:50:45Z","pushed_at":"2015-12-09T20:27:22Z","git_url":"git://github.com/Ian-Stewart-Binks/sti-nodejs.git","ssh_url":"git@github.com:Ian-Stewart-Binks/sti-nodejs.git","clone_url":"https://github.com/Ian-Stewart-Binks/sti-nodejs.git","svn_url":"https://github.com/Ian-Stewart-Binks/sti-nodejs","homepage":null,"size":115,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"f899cbbdfd142bbcebca6e8bd5ad885848e90805","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":30316706,"name":"sti-nodejs","full_name":"openshift/sti-nodejs","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/sti-nodejs","description":"","fork":false,"url":"https://api.github.com/repos/openshift/sti-nodejs","forks_url":"https://api.github.com/repos/openshift/sti-nodejs/forks","keys_url":"https://api.github.com/repos/openshift/sti-nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/sti-nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/sti-nodejs/teams","hooks_url":"https://api.github.com/repos/openshift/sti-nodejs/hooks","issue_events_url":"https://api.github.com/repos/openshift/sti-nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/sti-nodejs/events","assignees_url":"https://api.github.com/repos/openshift/sti-nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/sti-nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/sti-nodejs/tags","blobs_url":"https://api.github.com/repos/openshift/sti-nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/sti-nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/sti-nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/sti-nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/sti-nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/sti-nodejs/languages","stargazers_url":"https://api.github.com/repos/openshift/sti-nodejs/stargazers","contributors_url":"https://api.github.com/repos/openshift/sti-nodejs/contributors","subscribers_url":"https://api.github.com/repos/openshift/sti-nodejs/subscribers","subscription_url":"https://api.github.com/repos/openshift/sti-nodejs/subscription","commits_url":"https://api.github.com/repos/openshift/sti-nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/sti-nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/sti-nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/sti-nodejs/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/sti-nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/sti-nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/sti-nodejs/merges","archive_url":"https://api.github.com/repos/openshift/sti-nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/sti-nodejs/downloads","issues_url":"https://api.github.com/repos/openshift/sti-nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/sti-nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/sti-nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/sti-nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/sti-nodejs/labels{/name}","releases_url":"https://api.github.com/repos/openshift/sti-nodejs/releases{/id}","created_at":"2015-02-04T19:26:46Z","updated_at":"2015-11-05T15:26:18Z","pushed_at":"2015-12-10T18:42:38Z","git_url":"git://github.com/openshift/sti-nodejs.git","ssh_url":"git@github.com:openshift/sti-nodejs.git","clone_url":"https://github.com/openshift/sti-nodejs.git","svn_url":"https://github.com/openshift/sti-nodejs","homepage":null,"size":151,"stargazers_count":10,"watchers_count":10,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":2,"forks":33,"open_issues":2,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/sti-nodejs/pulls/77"},"html":{"href":"https://github.com/openshift/sti-nodejs/pull/77"},"issue":{"href":"https://api.github.com/repos/openshift/sti-nodejs/issues/77"},"comments":{"href":"https://api.github.com/repos/openshift/sti-nodejs/issues/77/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/sti-nodejs/pulls/77/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/sti-nodejs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/sti-nodejs/pulls/77/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/sti-nodejs/statuses/be7697e6471b31e2220f8288d4e8c2371fbd785f"}}}}