{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/php-docker/issues/138","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/php-docker","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/php-docker/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/php-docker/issues/138/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/php-docker/issues/138/events","html_url":"https://github.com/GoogleCloudPlatform/php-docker/pull/138","id":170060980,"number":138,"title":"Run composer as www-data.","user":{"login":"tmatsuo","id":41815,"avatar_url":"https://avatars.githubusercontent.com/u/41815?v=3","gravatar_id":"","url":"https://api.github.com/users/tmatsuo","html_url":"https://github.com/tmatsuo","followers_url":"https://api.github.com/users/tmatsuo/followers","following_url":"https://api.github.com/users/tmatsuo/following{/other_user}","gists_url":"https://api.github.com/users/tmatsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/tmatsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmatsuo/subscriptions","organizations_url":"https://api.github.com/users/tmatsuo/orgs","repos_url":"https://api.github.com/users/tmatsuo/repos","events_url":"https://api.github.com/users/tmatsuo/events{/privacy}","received_events_url":"https://api.github.com/users/tmatsuo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/php-docker/labels/cla:%20yes","name":"cla: yes","color":"c7def8"}],"state":"open","locked":false,"assignee":{"login":"bshaffer","id":103941,"avatar_url":"https://avatars.githubusercontent.com/u/103941?v=3","gravatar_id":"","url":"https://api.github.com/users/bshaffer","html_url":"https://github.com/bshaffer","followers_url":"https://api.github.com/users/bshaffer/followers","following_url":"https://api.github.com/users/bshaffer/following{/other_user}","gists_url":"https://api.github.com/users/bshaffer/gists{/gist_id}","starred_url":"https://api.github.com/users/bshaffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bshaffer/subscriptions","organizations_url":"https://api.github.com/users/bshaffer/orgs","repos_url":"https://api.github.com/users/bshaffer/repos","events_url":"https://api.github.com/users/bshaffer/events{/privacy}","received_events_url":"https://api.github.com/users/bshaffer/received_events","type":"User","site_admin":false},"assignees":[{"login":"bshaffer","id":103941,"avatar_url":"https://avatars.githubusercontent.com/u/103941?v=3","gravatar_id":"","url":"https://api.github.com/users/bshaffer","html_url":"https://github.com/bshaffer","followers_url":"https://api.github.com/users/bshaffer/followers","following_url":"https://api.github.com/users/bshaffer/following{/other_user}","gists_url":"https://api.github.com/users/bshaffer/gists{/gist_id}","starred_url":"https://api.github.com/users/bshaffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bshaffer/subscriptions","organizations_url":"https://api.github.com/users/bshaffer/orgs","repos_url":"https://api.github.com/users/bshaffer/repos","events_url":"https://api.github.com/users/bshaffer/events{/privacy}","received_events_url":"https://api.github.com/users/bshaffer/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-08-09T01:13:08Z","updated_at":"2016-08-09T17:39:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/php-docker/pulls/138","html_url":"https://github.com/GoogleCloudPlatform/php-docker/pull/138","diff_url":"https://github.com/GoogleCloudPlatform/php-docker/pull/138.diff","patch_url":"https://github.com/GoogleCloudPlatform/php-docker/pull/138.patch"},"body":"Under the cover it does many things:\r\n\r\n* Temporarily enable shell for `www-data` user\r\n* Run composer as `www-data`\r\n* chown -R www-data.www-data ${APP_DIR}\r\n* Permission changes regarding to this\r\n* After running the `post-deploy-cmd`, disable the shell entry for `www-data` user and lock down the ${DOCUMENT_ROOT} (instead of locking down the entire ${APP_DIR})\r\n\r\nHowever, looking at the surface, it is very simple:\r\n* For simple customization, you can use `post-deploy-cmd` which is executed by `www-data`\r\n* ${DOCUMENT_ROOT} is locked down to `root.www-data` 0550, but ${APP_DIR} is owned by `www-data` and it should be writable while it is still recommended to use `/tmp`\r\n* Because www-data runs `composer install`, the files generated by the composer scripts can be accessible from the web app\r\n\r\nMy only concern is https://github.com/docker/docker/issues/6047 which may cause nasty permission errors."},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/php-docker/issues/comments/238630698","html_url":"https://github.com/GoogleCloudPlatform/php-docker/pull/138#issuecomment-238630698","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/php-docker/issues/138","id":238630698,"user":{"login":"tmatsuo","id":41815,"avatar_url":"https://avatars.githubusercontent.com/u/41815?v=3","gravatar_id":"","url":"https://api.github.com/users/tmatsuo","html_url":"https://github.com/tmatsuo","followers_url":"https://api.github.com/users/tmatsuo/followers","following_url":"https://api.github.com/users/tmatsuo/following{/other_user}","gists_url":"https://api.github.com/users/tmatsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/tmatsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmatsuo/subscriptions","organizations_url":"https://api.github.com/users/tmatsuo/orgs","repos_url":"https://api.github.com/users/tmatsuo/repos","events_url":"https://api.github.com/users/tmatsuo/events{/privacy}","received_events_url":"https://api.github.com/users/tmatsuo/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T17:39:10Z","updated_at":"2016-08-09T17:39:10Z","body":"@bshaffer PTAL!"}}
{"actor":{"display_login":"tmatsuo"}}