{"action":"created","comment":{"url":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/comments/28262470","id":28262470,"diff_hunk":"@@ -1,11 +1,35 @@\n FROM ubuntu:14.04\n ENV DEBIAN_FRONTEND noninteractive\n-RUN apt-get update -q && apt-get install -y netbase python\n+\n+# Install ubuntu packages\n+RUN apt-get update -q && \\\n+        apt-get install -y netbase python nginx && \\\n+        rm -rf /var/lib/apt/lists/*\n ADD https://raw.github.com/pypa/pip/master/contrib/get-pip.py /get-pip.py    \n+\n+# Install devpi\n RUN python /get-pip.py\n RUN pip install \"devpi-server>=2.0.6,<2.1dev\" \"devpi-client>=2.0.2,<2.1dev\" \\\n         \"requests>=2.4.0,<2.5\"\n+\n+# By default expose a data volume\n VOLUME /mnt\n+\n+# By default Nginx will listen on port 3141 for HTTP and 3142 on HTTPS\n EXPOSE 3141\n+EXPOSE 3142\n+\n+# devpi-server will listen on 127.0.0.1:3143 by default\n+EXPOSE 3143","path":"Dockerfile","position":24,"original_position":24,"commit_id":"23c8010dc67eafa6da5b2382608626d2a3139f58","original_commit_id":"23c8010dc67eafa6da5b2382608626d2a3139f58","user":{"login":"dangra","id":37369,"avatar_url":"https://avatars.githubusercontent.com/u/37369?v=3","gravatar_id":"","url":"https://api.github.com/users/dangra","html_url":"https://github.com/dangra","followers_url":"https://api.github.com/users/dangra/followers","following_url":"https://api.github.com/users/dangra/following{/other_user}","gists_url":"https://api.github.com/users/dangra/gists{/gist_id}","starred_url":"https://api.github.com/users/dangra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangra/subscriptions","organizations_url":"https://api.github.com/users/dangra/orgs","repos_url":"https://api.github.com/users/dangra/repos","events_url":"https://api.github.com/users/dangra/events{/privacy}","received_events_url":"https://api.github.com/users/dangra/received_events","type":"User","site_admin":false},"body":"you can group exposed ports into a single EXPOSE directive, see https://docs.docker.com/reference/builder/#expose\r\n\r\nIt will generate one image layer instead of 3.","created_at":"2015-04-13T18:05:50Z","updated_at":"2015-04-13T18:05:50Z","html_url":"https://github.com/scrapinghub/docker-devpi/pull/2#discussion_r28262470","pull_request_url":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/comments/28262470"},"html":{"href":"https://github.com/scrapinghub/docker-devpi/pull/2#discussion_r28262470"},"pull_request":{"href":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/2","id":32977409,"html_url":"https://github.com/scrapinghub/docker-devpi/pull/2","diff_url":"https://github.com/scrapinghub/docker-devpi/pull/2.diff","patch_url":"https://github.com/scrapinghub/docker-devpi/pull/2.patch","issue_url":"https://api.github.com/repos/scrapinghub/docker-devpi/issues/2","number":2,"state":"open","locked":false,"title":"Use Nginx as reverse proxy","user":{"login":"little-dude","id":6646324,"avatar_url":"https://avatars.githubusercontent.com/u/6646324?v=3","gravatar_id":"","url":"https://api.github.com/users/little-dude","html_url":"https://github.com/little-dude","followers_url":"https://api.github.com/users/little-dude/followers","following_url":"https://api.github.com/users/little-dude/following{/other_user}","gists_url":"https://api.github.com/users/little-dude/gists{/gist_id}","starred_url":"https://api.github.com/users/little-dude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/little-dude/subscriptions","organizations_url":"https://api.github.com/users/little-dude/orgs","repos_url":"https://api.github.com/users/little-dude/repos","events_url":"https://api.github.com/users/little-dude/events{/privacy}","received_events_url":"https://api.github.com/users/little-dude/received_events","type":"User","site_admin":false},"body":"I found your image thanks to https://dantehranian.wordpress.com/2014/09/03/a-local-caching-proxy-for-pypi-python-org-via-docker/ \r\n\r\nI'd like to use NGINX to do https. This PR does not introduce HTTPS yet, but it adds nginx as reverse proxy, which is the first step.\r\n\r\nThere are some other smaller changes (see the commit message) which are not directly related, so let me know if you want me to do several PRs.\r\n\r\nFrom a user point of view those changes should be transparent. The behaviour is unchanged, but hunder the hood, the image uses nginx as reverse proxy.\r\n\r\nNote that despite the fact that everything is working, I'm seeing errors in nginx logs sometimes :\r\n```\r\n2015/04/09 15:45:05 [error] 78#0: *8 connect() failed (111: Connection refused) while connecting to upstream, client: 172.17.42.1, server: localhost, request: \"GET /root/dev HTTP/1.1\", upstream: \"http://[::1]:3142/root/dev\", host: \"localhost:3141\"\r\n```\r\n\r\nI'm not familiar with nginx so if you have any idea to fix this...","created_at":"2015-04-09T17:27:14Z","updated_at":"2015-04-13T18:05:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb379a6c315355f978fa1cfc8b585633d7fd371e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/2/commits","review_comments_url":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/2/comments","review_comment_url":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scrapinghub/docker-devpi/issues/2/comments","statuses_url":"https://api.github.com/repos/scrapinghub/docker-devpi/statuses/23c8010dc67eafa6da5b2382608626d2a3139f58","head":{"label":"little-dude:nginx","ref":"nginx","sha":"23c8010dc67eafa6da5b2382608626d2a3139f58","user":{"login":"little-dude","id":6646324,"avatar_url":"https://avatars.githubusercontent.com/u/6646324?v=3","gravatar_id":"","url":"https://api.github.com/users/little-dude","html_url":"https://github.com/little-dude","followers_url":"https://api.github.com/users/little-dude/followers","following_url":"https://api.github.com/users/little-dude/following{/other_user}","gists_url":"https://api.github.com/users/little-dude/gists{/gist_id}","starred_url":"https://api.github.com/users/little-dude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/little-dude/subscriptions","organizations_url":"https://api.github.com/users/little-dude/orgs","repos_url":"https://api.github.com/users/little-dude/repos","events_url":"https://api.github.com/users/little-dude/events{/privacy}","received_events_url":"https://api.github.com/users/little-dude/received_events","type":"User","site_admin":false},"repo":{"id":33616819,"name":"docker-devpi","full_name":"little-dude/docker-devpi","owner":{"login":"little-dude","id":6646324,"avatar_url":"https://avatars.githubusercontent.com/u/6646324?v=3","gravatar_id":"","url":"https://api.github.com/users/little-dude","html_url":"https://github.com/little-dude","followers_url":"https://api.github.com/users/little-dude/followers","following_url":"https://api.github.com/users/little-dude/following{/other_user}","gists_url":"https://api.github.com/users/little-dude/gists{/gist_id}","starred_url":"https://api.github.com/users/little-dude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/little-dude/subscriptions","organizations_url":"https://api.github.com/users/little-dude/orgs","repos_url":"https://api.github.com/users/little-dude/repos","events_url":"https://api.github.com/users/little-dude/events{/privacy}","received_events_url":"https://api.github.com/users/little-dude/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/little-dude/docker-devpi","description":"pypi caching service using devpi and docker","fork":true,"url":"https://api.github.com/repos/little-dude/docker-devpi","forks_url":"https://api.github.com/repos/little-dude/docker-devpi/forks","keys_url":"https://api.github.com/repos/little-dude/docker-devpi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/little-dude/docker-devpi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/little-dude/docker-devpi/teams","hooks_url":"https://api.github.com/repos/little-dude/docker-devpi/hooks","issue_events_url":"https://api.github.com/repos/little-dude/docker-devpi/issues/events{/number}","events_url":"https://api.github.com/repos/little-dude/docker-devpi/events","assignees_url":"https://api.github.com/repos/little-dude/docker-devpi/assignees{/user}","branches_url":"https://api.github.com/repos/little-dude/docker-devpi/branches{/branch}","tags_url":"https://api.github.com/repos/little-dude/docker-devpi/tags","blobs_url":"https://api.github.com/repos/little-dude/docker-devpi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/little-dude/docker-devpi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/little-dude/docker-devpi/git/refs{/sha}","trees_url":"https://api.github.com/repos/little-dude/docker-devpi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/little-dude/docker-devpi/statuses/{sha}","languages_url":"https://api.github.com/repos/little-dude/docker-devpi/languages","stargazers_url":"https://api.github.com/repos/little-dude/docker-devpi/stargazers","contributors_url":"https://api.github.com/repos/little-dude/docker-devpi/contributors","subscribers_url":"https://api.github.com/repos/little-dude/docker-devpi/subscribers","subscription_url":"https://api.github.com/repos/little-dude/docker-devpi/subscription","commits_url":"https://api.github.com/repos/little-dude/docker-devpi/commits{/sha}","git_commits_url":"https://api.github.com/repos/little-dude/docker-devpi/git/commits{/sha}","comments_url":"https://api.github.com/repos/little-dude/docker-devpi/comments{/number}","issue_comment_url":"https://api.github.com/repos/little-dude/docker-devpi/issues/comments{/number}","contents_url":"https://api.github.com/repos/little-dude/docker-devpi/contents/{+path}","compare_url":"https://api.github.com/repos/little-dude/docker-devpi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/little-dude/docker-devpi/merges","archive_url":"https://api.github.com/repos/little-dude/docker-devpi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/little-dude/docker-devpi/downloads","issues_url":"https://api.github.com/repos/little-dude/docker-devpi/issues{/number}","pulls_url":"https://api.github.com/repos/little-dude/docker-devpi/pulls{/number}","milestones_url":"https://api.github.com/repos/little-dude/docker-devpi/milestones{/number}","notifications_url":"https://api.github.com/repos/little-dude/docker-devpi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/little-dude/docker-devpi/labels{/name}","releases_url":"https://api.github.com/repos/little-dude/docker-devpi/releases{/id}","created_at":"2015-04-08T15:53:33Z","updated_at":"2015-04-08T15:53:33Z","pushed_at":"2015-04-13T16:58:00Z","git_url":"git://github.com/little-dude/docker-devpi.git","ssh_url":"git@github.com:little-dude/docker-devpi.git","clone_url":"https://github.com/little-dude/docker-devpi.git","svn_url":"https://github.com/little-dude/docker-devpi","homepage":null,"size":89,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scrapinghub:master","ref":"master","sha":"b2ed884d7fe4731909b1d1b743265d990086304d","user":{"login":"scrapinghub","id":699596,"avatar_url":"https://avatars.githubusercontent.com/u/699596?v=3","gravatar_id":"","url":"https://api.github.com/users/scrapinghub","html_url":"https://github.com/scrapinghub","followers_url":"https://api.github.com/users/scrapinghub/followers","following_url":"https://api.github.com/users/scrapinghub/following{/other_user}","gists_url":"https://api.github.com/users/scrapinghub/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapinghub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapinghub/subscriptions","organizations_url":"https://api.github.com/users/scrapinghub/orgs","repos_url":"https://api.github.com/users/scrapinghub/repos","events_url":"https://api.github.com/users/scrapinghub/events{/privacy}","received_events_url":"https://api.github.com/users/scrapinghub/received_events","type":"Organization","site_admin":false},"repo":{"id":17913581,"name":"docker-devpi","full_name":"scrapinghub/docker-devpi","owner":{"login":"scrapinghub","id":699596,"avatar_url":"https://avatars.githubusercontent.com/u/699596?v=3","gravatar_id":"","url":"https://api.github.com/users/scrapinghub","html_url":"https://github.com/scrapinghub","followers_url":"https://api.github.com/users/scrapinghub/followers","following_url":"https://api.github.com/users/scrapinghub/following{/other_user}","gists_url":"https://api.github.com/users/scrapinghub/gists{/gist_id}","starred_url":"https://api.github.com/users/scrapinghub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrapinghub/subscriptions","organizations_url":"https://api.github.com/users/scrapinghub/orgs","repos_url":"https://api.github.com/users/scrapinghub/repos","events_url":"https://api.github.com/users/scrapinghub/events{/privacy}","received_events_url":"https://api.github.com/users/scrapinghub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scrapinghub/docker-devpi","description":"pypi caching service using devpi and docker","fork":false,"url":"https://api.github.com/repos/scrapinghub/docker-devpi","forks_url":"https://api.github.com/repos/scrapinghub/docker-devpi/forks","keys_url":"https://api.github.com/repos/scrapinghub/docker-devpi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scrapinghub/docker-devpi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scrapinghub/docker-devpi/teams","hooks_url":"https://api.github.com/repos/scrapinghub/docker-devpi/hooks","issue_events_url":"https://api.github.com/repos/scrapinghub/docker-devpi/issues/events{/number}","events_url":"https://api.github.com/repos/scrapinghub/docker-devpi/events","assignees_url":"https://api.github.com/repos/scrapinghub/docker-devpi/assignees{/user}","branches_url":"https://api.github.com/repos/scrapinghub/docker-devpi/branches{/branch}","tags_url":"https://api.github.com/repos/scrapinghub/docker-devpi/tags","blobs_url":"https://api.github.com/repos/scrapinghub/docker-devpi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scrapinghub/docker-devpi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scrapinghub/docker-devpi/git/refs{/sha}","trees_url":"https://api.github.com/repos/scrapinghub/docker-devpi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scrapinghub/docker-devpi/statuses/{sha}","languages_url":"https://api.github.com/repos/scrapinghub/docker-devpi/languages","stargazers_url":"https://api.github.com/repos/scrapinghub/docker-devpi/stargazers","contributors_url":"https://api.github.com/repos/scrapinghub/docker-devpi/contributors","subscribers_url":"https://api.github.com/repos/scrapinghub/docker-devpi/subscribers","subscription_url":"https://api.github.com/repos/scrapinghub/docker-devpi/subscription","commits_url":"https://api.github.com/repos/scrapinghub/docker-devpi/commits{/sha}","git_commits_url":"https://api.github.com/repos/scrapinghub/docker-devpi/git/commits{/sha}","comments_url":"https://api.github.com/repos/scrapinghub/docker-devpi/comments{/number}","issue_comment_url":"https://api.github.com/repos/scrapinghub/docker-devpi/issues/comments{/number}","contents_url":"https://api.github.com/repos/scrapinghub/docker-devpi/contents/{+path}","compare_url":"https://api.github.com/repos/scrapinghub/docker-devpi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scrapinghub/docker-devpi/merges","archive_url":"https://api.github.com/repos/scrapinghub/docker-devpi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scrapinghub/docker-devpi/downloads","issues_url":"https://api.github.com/repos/scrapinghub/docker-devpi/issues{/number}","pulls_url":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls{/number}","milestones_url":"https://api.github.com/repos/scrapinghub/docker-devpi/milestones{/number}","notifications_url":"https://api.github.com/repos/scrapinghub/docker-devpi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scrapinghub/docker-devpi/labels{/name}","releases_url":"https://api.github.com/repos/scrapinghub/docker-devpi/releases{/id}","created_at":"2014-03-19T17:25:10Z","updated_at":"2015-04-09T17:45:21Z","pushed_at":"2015-04-13T16:58:00Z","git_url":"git://github.com/scrapinghub/docker-devpi.git","ssh_url":"git@github.com:scrapinghub/docker-devpi.git","clone_url":"https://github.com/scrapinghub/docker-devpi.git","svn_url":"https://github.com/scrapinghub/docker-devpi","homepage":null,"size":261,"stargazers_count":6,"watchers_count":6,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":1,"forks":7,"open_issues":1,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/2"},"html":{"href":"https://github.com/scrapinghub/docker-devpi/pull/2"},"issue":{"href":"https://api.github.com/repos/scrapinghub/docker-devpi/issues/2"},"comments":{"href":"https://api.github.com/repos/scrapinghub/docker-devpi/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scrapinghub/docker-devpi/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/scrapinghub/docker-devpi/statuses/23c8010dc67eafa6da5b2382608626d2a3139f58"}}}}