{"action":"created","comment":{"url":"https://api.github.com/repos/vuejs/vuejs.org/pulls/comments/195933932","pull_request_review_id":129393991,"id":195933932,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTkzMzkzMg==","diff_hunk":"@@ -0,0 +1,130 @@\n+---\n+title: Dockerize Vue.js App\n+type: cookbook\n+order: 8\n+---\n+\n+## Simple Example\n+\n+So you built your first Vue.js app using the amazing [Vue.js webpack template](https://github.com/vuejs-templates/webpack) and now you really want to show off with your colleagues by demonstrating that you can also run it in a Docker container.\n+\n+Let's start by creating a `Dockerfile` in the root folder of our project:\n+\n+```docker\n+FROM node:9.11.1-alpine\n+\n+# install simple http server for serving static content\n+RUN npm install -g http-server\n+\n+# make the 'app' folder the current working directory\n+WORKDIR /app\n+\n+# copy both 'package.json' and 'package-lock.json' (if available)\n+COPY package*.json ./\n+\n+# install project dependencies\n+RUN npm install\n+\n+# copy project files and folders to the current working directory (i.e. 'app' folder)\n+COPY . .\n+\n+# build app for production with minification\n+RUN npm run build\n+\n+EXPOSE 8080\n+CMD [ \"http-server\", \"dist\" ]\n+```\n+\n+It may seem reduntant to first copy `package.json` and `package-lock.json` and then all project files and folders in two separate steps but there is actually [a very good reason for that](http://bitjudo.com/blog/2014/03/13/building-efficient-dockerfiles-node-dot-js/) (spoiler: it allows us to take advantage of cached Docker layers).\n+\n+Now let's build the Docker image of our Vue.js app:\n+\n+```bash\n+docker build -t vuejs-cookbook/dockerize-vuejs-app .\n+```\n+\n+Finally, let's run our Vue.js app in a Docker container:\n+\n+```bash\n+docker run -it -p 8080:8080 --rm --name dockerize-vuejs-app-1 vuejs-cookbook/dockerize-vuejs-app\n+```\n+\n+We should be able to access our Vue.js app on `localhost:8080`.\n+\n+## Real-World Example\n+\n+In the previous example, we used a simple, zero-configuration command-line [http server](https://github.com/indexzero/http-server) to serve our Vue.js app. Your colleagues are impressed but your boss is still shaking his head because we chose not to stand on the shoulders of some giant like [NGINX](https://www.nginx.com/) or [Apache](https://httpd.apache.org/). Now we are going to make it right.","path":"src/v2/cookbook/dockerize-vuejs-app.md","position":56,"original_position":56,"commit_id":"7f9aa12833c085b97a826df3ba240f7d9e069e1b","original_commit_id":"7f9aa12833c085b97a826df3ba240f7d9e069e1b","user":{"login":"sdras","id":2281088,"node_id":"MDQ6VXNlcjIyODEwODg=","avatar_url":"https://avatars1.githubusercontent.com/u/2281088?v=4","gravatar_id":"","url":"https://api.github.com/users/sdras","html_url":"https://github.com/sdras","followers_url":"https://api.github.com/users/sdras/followers","following_url":"https://api.github.com/users/sdras/following{/other_user}","gists_url":"https://api.github.com/users/sdras/gists{/gist_id}","starred_url":"https://api.github.com/users/sdras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdras/subscriptions","organizations_url":"https://api.github.com/users/sdras/orgs","repos_url":"https://api.github.com/users/sdras/repos","events_url":"https://api.github.com/users/sdras/events{/privacy}","received_events_url":"https://api.github.com/users/sdras/received_events","type":"User","site_admin":false},"body":"This paragraph reads pretty strangely to me- it's not terribly important to be impressive to your colleagues, (not to mention the pronoun should be 'their' for boss), but there' not an explanation of _why_ it's helpful to use nginx here, @henripal hinted at this earlier. I'm not questioning your use of nginx, but there should be some technical explanation of why we might make a change like this, for clarity.","created_at":"2018-06-17T16:05:31Z","updated_at":"2018-06-17T16:05:31Z","html_url":"https://github.com/vuejs/vuejs.org/pull/1483#discussion_r195933932","pull_request_url":"https://api.github.com/repos/vuejs/vuejs.org/pulls/1483","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/vuejs/vuejs.org/pulls/comments/195933932"},"html":{"href":"https://github.com/vuejs/vuejs.org/pull/1483#discussion_r195933932"},"pull_request":{"href":"https://api.github.com/repos/vuejs/vuejs.org/pulls/1483"}}},"pull_request":{"url":"https://api.github.com/repos/vuejs/vuejs.org/pulls/1483","id":174248748,"node_id":"MDExOlB1bGxSZXF1ZXN0MTc0MjQ4NzQ4","html_url":"https://github.com/vuejs/vuejs.org/pull/1483","diff_url":"https://github.com/vuejs/vuejs.org/pull/1483.diff","patch_url":"https://github.com/vuejs/vuejs.org/pull/1483.patch","issue_url":"https://api.github.com/repos/vuejs/vuejs.org/issues/1483","number":1483,"state":"open","locked":false,"title":"[cookbook] Dockerize Vue.js App","user":{"login":"fabriziocucci","id":8156463,"node_id":"MDQ6VXNlcjgxNTY0NjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8156463?v=4","gravatar_id":"","url":"https://api.github.com/users/fabriziocucci","html_url":"https://github.com/fabriziocucci","followers_url":"https://api.github.com/users/fabriziocucci/followers","following_url":"https://api.github.com/users/fabriziocucci/following{/other_user}","gists_url":"https://api.github.com/users/fabriziocucci/gists{/gist_id}","starred_url":"https://api.github.com/users/fabriziocucci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabriziocucci/subscriptions","organizations_url":"https://api.github.com/users/fabriziocucci/orgs","repos_url":"https://api.github.com/users/fabriziocucci/repos","events_url":"https://api.github.com/users/fabriziocucci/events{/privacy}","received_events_url":"https://api.github.com/users/fabriziocucci/received_events","type":"User","site_admin":false},"body":"@sdras \r\n\r\nAs promised, I've created the first draft of [this](https://github.com/vuejs/vuejs.org/issues/1357) cookbook idea so that we can start deciding which direction we want it to go, specifically:\r\n1. do you think the `Simple Example` is simple enough or should we move the Docker caching layer optimization in a `Real-World Example`?\r\n2. do you think we should have a `Real-World Example` that replaces the simple [http-server](https://github.com/indexzero/http-server) with something a little bit more \"robust\" like nginx?\r\n3. is there anything you would change about this first draft?\r\n4. did you have something else in mind?\r\n\r\n(This closes https://github.com/vuejs/vuejs.org/issues/1357)","created_at":"2018-03-11T23:20:01Z","updated_at":"2018-06-17T16:05:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbf538fae24d9a9f589b53b5ae46d3cb533b3303","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":746024319,"node_id":"MDU6TGFiZWw3NDYwMjQzMTk=","url":"https://api.github.com/repos/vuejs/vuejs.org/labels/cookbook","name":"cookbook","color":"08ce75","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/vuejs/vuejs.org/pulls/1483/commits","review_comments_url":"https://api.github.com/repos/vuejs/vuejs.org/pulls/1483/comments","review_comment_url":"https://api.github.com/repos/vuejs/vuejs.org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vuejs/vuejs.org/issues/1483/comments","statuses_url":"https://api.github.com/repos/vuejs/vuejs.org/statuses/7f9aa12833c085b97a826df3ba240f7d9e069e1b","head":{"label":"fabriziocucci:cookbook-dockerize-vuejs-app","ref":"cookbook-dockerize-vuejs-app","sha":"7f9aa12833c085b97a826df3ba240f7d9e069e1b","user":{"login":"fabriziocucci","id":8156463,"node_id":"MDQ6VXNlcjgxNTY0NjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8156463?v=4","gravatar_id":"","url":"https://api.github.com/users/fabriziocucci","html_url":"https://github.com/fabriziocucci","followers_url":"https://api.github.com/users/fabriziocucci/followers","following_url":"https://api.github.com/users/fabriziocucci/following{/other_user}","gists_url":"https://api.github.com/users/fabriziocucci/gists{/gist_id}","starred_url":"https://api.github.com/users/fabriziocucci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabriziocucci/subscriptions","organizations_url":"https://api.github.com/users/fabriziocucci/orgs","repos_url":"https://api.github.com/users/fabriziocucci/repos","events_url":"https://api.github.com/users/fabriziocucci/events{/privacy}","received_events_url":"https://api.github.com/users/fabriziocucci/received_events","type":"User","site_admin":false},"repo":{"id":115911345,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU5MTEzNDU=","name":"vuejs.org","full_name":"fabriziocucci/vuejs.org","owner":{"login":"fabriziocucci","id":8156463,"node_id":"MDQ6VXNlcjgxNTY0NjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8156463?v=4","gravatar_id":"","url":"https://api.github.com/users/fabriziocucci","html_url":"https://github.com/fabriziocucci","followers_url":"https://api.github.com/users/fabriziocucci/followers","following_url":"https://api.github.com/users/fabriziocucci/following{/other_user}","gists_url":"https://api.github.com/users/fabriziocucci/gists{/gist_id}","starred_url":"https://api.github.com/users/fabriziocucci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabriziocucci/subscriptions","organizations_url":"https://api.github.com/users/fabriziocucci/orgs","repos_url":"https://api.github.com/users/fabriziocucci/repos","events_url":"https://api.github.com/users/fabriziocucci/events{/privacy}","received_events_url":"https://api.github.com/users/fabriziocucci/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fabriziocucci/vuejs.org","description":"📃 The official documentation site for Vue.js.","fork":true,"url":"https://api.github.com/repos/fabriziocucci/vuejs.org","forks_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/forks","keys_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/teams","hooks_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/hooks","issue_events_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/issues/events{/number}","events_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/events","assignees_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/assignees{/user}","branches_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/branches{/branch}","tags_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/tags","blobs_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/statuses/{sha}","languages_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/languages","stargazers_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/stargazers","contributors_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/contributors","subscribers_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/subscribers","subscription_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/subscription","commits_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/contents/{+path}","compare_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/merges","archive_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/downloads","issues_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/issues{/number}","pulls_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/pulls{/number}","milestones_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/milestones{/number}","notifications_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/labels{/name}","releases_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/releases{/id}","deployments_url":"https://api.github.com/repos/fabriziocucci/vuejs.org/deployments","created_at":"2018-01-01T09:57:11Z","updated_at":"2018-01-01T09:57:14Z","pushed_at":"2018-04-15T20:40:03Z","git_url":"git://github.com/fabriziocucci/vuejs.org.git","ssh_url":"git@github.com:fabriziocucci/vuejs.org.git","clone_url":"https://github.com/fabriziocucci/vuejs.org.git","svn_url":"https://github.com/fabriziocucci/vuejs.org","homepage":"https://vuejs.org","size":41910,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vuejs:master","ref":"master","sha":"3755a202699b3179c2ca3ccc2126bf446ee7cb2b","user":{"login":"vuejs","id":6128107,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxMjgxMDc=","avatar_url":"https://avatars1.githubusercontent.com/u/6128107?v=4","gravatar_id":"","url":"https://api.github.com/users/vuejs","html_url":"https://github.com/vuejs","followers_url":"https://api.github.com/users/vuejs/followers","following_url":"https://api.github.com/users/vuejs/following{/other_user}","gists_url":"https://api.github.com/users/vuejs/gists{/gist_id}","starred_url":"https://api.github.com/users/vuejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuejs/subscriptions","organizations_url":"https://api.github.com/users/vuejs/orgs","repos_url":"https://api.github.com/users/vuejs/repos","events_url":"https://api.github.com/users/vuejs/events{/privacy}","received_events_url":"https://api.github.com/users/vuejs/received_events","type":"Organization","site_admin":false},"repo":{"id":15644594,"node_id":"MDEwOlJlcG9zaXRvcnkxNTY0NDU5NA==","name":"vuejs.org","full_name":"vuejs/vuejs.org","owner":{"login":"vuejs","id":6128107,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxMjgxMDc=","avatar_url":"https://avatars1.githubusercontent.com/u/6128107?v=4","gravatar_id":"","url":"https://api.github.com/users/vuejs","html_url":"https://github.com/vuejs","followers_url":"https://api.github.com/users/vuejs/followers","following_url":"https://api.github.com/users/vuejs/following{/other_user}","gists_url":"https://api.github.com/users/vuejs/gists{/gist_id}","starred_url":"https://api.github.com/users/vuejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuejs/subscriptions","organizations_url":"https://api.github.com/users/vuejs/orgs","repos_url":"https://api.github.com/users/vuejs/repos","events_url":"https://api.github.com/users/vuejs/events{/privacy}","received_events_url":"https://api.github.com/users/vuejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vuejs/vuejs.org","description":"📄 The official documentation site for Vue.js.","fork":false,"url":"https://api.github.com/repos/vuejs/vuejs.org","forks_url":"https://api.github.com/repos/vuejs/vuejs.org/forks","keys_url":"https://api.github.com/repos/vuejs/vuejs.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vuejs/vuejs.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vuejs/vuejs.org/teams","hooks_url":"https://api.github.com/repos/vuejs/vuejs.org/hooks","issue_events_url":"https://api.github.com/repos/vuejs/vuejs.org/issues/events{/number}","events_url":"https://api.github.com/repos/vuejs/vuejs.org/events","assignees_url":"https://api.github.com/repos/vuejs/vuejs.org/assignees{/user}","branches_url":"https://api.github.com/repos/vuejs/vuejs.org/branches{/branch}","tags_url":"https://api.github.com/repos/vuejs/vuejs.org/tags","blobs_url":"https://api.github.com/repos/vuejs/vuejs.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vuejs/vuejs.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vuejs/vuejs.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/vuejs/vuejs.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vuejs/vuejs.org/statuses/{sha}","languages_url":"https://api.github.com/repos/vuejs/vuejs.org/languages","stargazers_url":"https://api.github.com/repos/vuejs/vuejs.org/stargazers","contributors_url":"https://api.github.com/repos/vuejs/vuejs.org/contributors","subscribers_url":"https://api.github.com/repos/vuejs/vuejs.org/subscribers","subscription_url":"https://api.github.com/repos/vuejs/vuejs.org/subscription","commits_url":"https://api.github.com/repos/vuejs/vuejs.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/vuejs/vuejs.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/vuejs/vuejs.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/vuejs/vuejs.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/vuejs/vuejs.org/contents/{+path}","compare_url":"https://api.github.com/repos/vuejs/vuejs.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vuejs/vuejs.org/merges","archive_url":"https://api.github.com/repos/vuejs/vuejs.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vuejs/vuejs.org/downloads","issues_url":"https://api.github.com/repos/vuejs/vuejs.org/issues{/number}","pulls_url":"https://api.github.com/repos/vuejs/vuejs.org/pulls{/number}","milestones_url":"https://api.github.com/repos/vuejs/vuejs.org/milestones{/number}","notifications_url":"https://api.github.com/repos/vuejs/vuejs.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vuejs/vuejs.org/labels{/name}","releases_url":"https://api.github.com/repos/vuejs/vuejs.org/releases{/id}","deployments_url":"https://api.github.com/repos/vuejs/vuejs.org/deployments","created_at":"2014-01-05T03:11:14Z","updated_at":"2018-06-17T13:26:01Z","pushed_at":"2018-06-17T13:25:55Z","git_url":"git://github.com/vuejs/vuejs.org.git","ssh_url":"git@github.com:vuejs/vuejs.org.git","clone_url":"https://github.com/vuejs/vuejs.org.git","svn_url":"https://github.com/vuejs/vuejs.org","homepage":"https://vuejs.org","size":45282,"stargazers_count":2412,"watchers_count":2412,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1872,"mirror_url":null,"archived":false,"open_issues_count":126,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1872,"open_issues":126,"watchers":2412,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vuejs/vuejs.org/pulls/1483"},"html":{"href":"https://github.com/vuejs/vuejs.org/pull/1483"},"issue":{"href":"https://api.github.com/repos/vuejs/vuejs.org/issues/1483"},"comments":{"href":"https://api.github.com/repos/vuejs/vuejs.org/issues/1483/comments"},"review_comments":{"href":"https://api.github.com/repos/vuejs/vuejs.org/pulls/1483/comments"},"review_comment":{"href":"https://api.github.com/repos/vuejs/vuejs.org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vuejs/vuejs.org/pulls/1483/commits"},"statuses":{"href":"https://api.github.com/repos/vuejs/vuejs.org/statuses/7f9aa12833c085b97a826df3ba240f7d9e069e1b"}},"author_association":"NONE"}}
{"actor":{"display_login":"sdras"}}