{"action":"created","comment":{"url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/comments/38928972","id":38928972,"diff_hunk":"@@ -33,40 +49,48 @@ RUN     sed -i 's,.*daemonize =.*,daemonize = no,' /etc/php5/fpm/php-fpm.conf &&\n \tsed -i 's,.*max_input_vars =.*,max_input_vars = 4000,' /etc/php5/fpm/php.ini && \\\n \tsed -i 's,.*error_reporting =.*,error_reporting = E_ALL \\& ~E_DEPRECATED \\& ~E_STRICT \\& ~E_NOTICE,' /etc/php5/fpm/php.ini\n \n-# Configure postgresql\n+# Configure postgresql access, remove default database \n COPY    pg_hba.conf /etc/postgresql/9.3/main/\n+RUN sed -i \"s/'\\\\/var\\\\/lib\\\\/postgresql\\\\/9.3\\\\/main'/'\\\\/notabenoid\\\\/dbdata'/g\" /etc/postgresql/9.3/main/postgresql.conf \\\n+\t&& rm -rf /var/lib/postgresql\n \n # Configure supervisord\n COPY    supervisor/*.conf /etc/supervisor/conf.d/\n \n # Add cron jobs\n-RUN   ( echo \"0 0 * * * /usr/bin/php /srv/$DOMAIN/protected/yiic maintain midnight\" && \\\n-\techo \"0 4 * * * /usr/bin/php /srv/$DOMAIN/protected/yiic maintain dailyfixes\" ) >> /etc/crontab\n-\n-# Clone the notabenoid repo, create directories, add write permissions, fix config files\n-RUN     git clone --depth=1 https://github.com/notabenoid/notabenoid.git /srv/$DOMAIN\n-WORKDIR /srv/$DOMAIN\n-RUN     mkdir -p www/assets www/i/book www/i/upic www/i/tmp/upiccut protected/runtime && \\\n-\tchown www-data www/assets www/i/book www/i/upic www/i/tmp www/i/tmp/upiccut protected/runtime && \\\n-\tcd protected/config && \\\n-\tsed -e '/domain/s%=>.*%=> \"'$DOMAIN'\",%' \\\n-\t    -e '/adminEmail/s%=>.*%=> \"'$ADMIN_EMAIL'\",%' \\\n-\t    -e '/commentEmail/s%=>.*%=> \"'$COMMENT_EMAIL'\",%' \\\n-\t    -e '/systemEmail/s%=>.*%=> \"'$SYSTEM_EMAIL'\",%' \\\n+RUN   ( echo \"0 0 * * * /usr/bin/php /notabenoid/site/protected/yiic maintain midnight\" && \\\n+\techo \"0 4 * * * /usr/bin/php /notabenoid/site/protected/yiic maintain dailyfixes\" ) >> /etc/crontab\n+\n+# Download the application\n+WORKDIR /notabenoid\n+RUN     wget --no-verbose -O site.tar.gz $NB_ARCHIVE_URL \\\n+\t&& mkdir site \\\n+\t&& tar xf site.tar.gz -C site --strip-components $NB_ARCHIVE_STRIPCOMP \\\n+\t&& rm -f site.zip","path":"Dockerfile","position":91,"original_position":91,"commit_id":"b1a9ebea7901fb3c7a3582d30e47027ab190ed2a","original_commit_id":"b1a9ebea7901fb3c7a3582d30e47027ab190ed2a","user":{"login":"opennota","id":5520115,"avatar_url":"https://avatars.githubusercontent.com/u/5520115?v=3","gravatar_id":"","url":"https://api.github.com/users/opennota","html_url":"https://github.com/opennota","followers_url":"https://api.github.com/users/opennota/followers","following_url":"https://api.github.com/users/opennota/following{/other_user}","gists_url":"https://api.github.com/users/opennota/gists{/gist_id}","starred_url":"https://api.github.com/users/opennota/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opennota/subscriptions","organizations_url":"https://api.github.com/users/opennota/orgs","repos_url":"https://api.github.com/users/opennota/repos","events_url":"https://api.github.com/users/opennota/events{/privacy}","received_events_url":"https://api.github.com/users/opennota/received_events","type":"User","site_admin":false},"body":"`-f` там тоже вроде не нужна.","created_at":"2015-09-08T14:06:08Z","updated_at":"2015-09-08T14:06:08Z","html_url":"https://github.com/notabenoid/notabenoid-dockerfile/pull/2#discussion_r38928972","pull_request_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/comments/38928972"},"html":{"href":"https://github.com/notabenoid/notabenoid-dockerfile/pull/2#discussion_r38928972"},"pull_request":{"href":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/2","id":44384629,"html_url":"https://github.com/notabenoid/notabenoid-dockerfile/pull/2","diff_url":"https://github.com/notabenoid/notabenoid-dockerfile/pull/2.diff","patch_url":"https://github.com/notabenoid/notabenoid-dockerfile/pull/2.patch","issue_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/issues/2","number":2,"state":"open","locked":false,"title":"Complete overhaul. Many new features and improvements.","user":{"login":"igormukhin","id":618760,"avatar_url":"https://avatars.githubusercontent.com/u/618760?v=3","gravatar_id":"","url":"https://api.github.com/users/igormukhin","html_url":"https://github.com/igormukhin","followers_url":"https://api.github.com/users/igormukhin/followers","following_url":"https://api.github.com/users/igormukhin/following{/other_user}","gists_url":"https://api.github.com/users/igormukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/igormukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igormukhin/subscriptions","organizations_url":"https://api.github.com/users/igormukhin/orgs","repos_url":"https://api.github.com/users/igormukhin/repos","events_url":"https://api.github.com/users/igormukhin/events{/privacy}","received_events_url":"https://api.github.com/users/igormukhin/received_events","type":"User","site_admin":false},"body":"Заинтересовался Докером и посидел тут пару дней. Вот такие улучшения и упрощения пришли на ум и были реализованы (хотя лучше мой README.md сначала прочитать, возможно понятнее будет):\r\n\r\n** Сделать ENTYPOINT, как на докере Postres **\r\n\r\n** Каталог с сайтом назвать просто /notabenoid/site **\r\n\r\nЧтобы он всегда одинаково назывался и лежал в уникальном каталоге, что облегчит бакапы с `--volumes-from`\r\n\r\n** Каталоги Ноты, куда она пишет аплоды, должны лежать вне www **\r\n\r\nЧтобы их тоже можно было объявить/подключить как вольюм.\r\n\r\nПопробовать сделать внутри контейнера так:\r\n- создать каталог: /notabenoid/files для www/i/book www/i/upic\r\n- создать каталог: /notabenoid/tmp для www/assets www/i/tmp/upiccut protected/runtime\r\n\r\n** Положить базу в /notabenoid/dbdata **\r\n\r\n** Выправить вольюмы **\r\n\r\nНе надо их форсировать, только самые важные. Можно указать в документации, где и что находися, чтобы пользователь сам решил, что ему еще надо.\r\n\r\n** Адрес, с которого берется приложение, должен быть настраиваемым. **\r\n\r\nЧтобы можно было выбрать определенную версию или свой репозиторий.\r\n\r\n** Сбор статистики 'maintain dailyfixes' должен осуществляться именно непосредственно перед стартом **\r\n\r\n** Начальная база данных должна создаваться только, если не существует **\r\n\r\nДругими словами, если мы подключаем контейнер к уже существующей базе, он должет проверить существует ли там наш пользователь, и если его нет, только тогда прогонять init.sql.\r\n\r\n** Сделать описание для разработчиков **\r\n\r\n** Добавить в описание, как подключится к базе контейнера для дебаггинга **\r\n\r\n** Админ-пользователь должен создаваться сразу **\r\n\r\nКак admin / admin.\r\n\r\n** Создавать пустую базу, если она не существует в /notabenoid/dbdata, при старте контейнера **\r\n\r\nЧтобы можно было использовать базу, сгенерированную в прошлом контейнере.\r\n\r\n** Создавать каталоги в /notabenoid/files, если они не существуют, при старте контейнера **\r\n\r\nЧтобы можно было использовать файлы, сгенерированные в прошлом контейнере.\r\n\r\n** Описать апдейт контейнера, сохранив вольюмы **\r\n\r\n** Сделать описание, что и как бакапить **","created_at":"2015-09-08T00:47:05Z","updated_at":"2015-09-08T14:06:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"043dbe01f37c59b42eca8f9e3f1f6d80d63bff18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/2/commits","review_comments_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/2/comments","review_comment_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/issues/2/comments","statuses_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/statuses/b1a9ebea7901fb3c7a3582d30e47027ab190ed2a","head":{"label":"igormukhin:master","ref":"master","sha":"b1a9ebea7901fb3c7a3582d30e47027ab190ed2a","user":{"login":"igormukhin","id":618760,"avatar_url":"https://avatars.githubusercontent.com/u/618760?v=3","gravatar_id":"","url":"https://api.github.com/users/igormukhin","html_url":"https://github.com/igormukhin","followers_url":"https://api.github.com/users/igormukhin/followers","following_url":"https://api.github.com/users/igormukhin/following{/other_user}","gists_url":"https://api.github.com/users/igormukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/igormukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igormukhin/subscriptions","organizations_url":"https://api.github.com/users/igormukhin/orgs","repos_url":"https://api.github.com/users/igormukhin/repos","events_url":"https://api.github.com/users/igormukhin/events{/privacy}","received_events_url":"https://api.github.com/users/igormukhin/received_events","type":"User","site_admin":false},"repo":{"id":42007979,"name":"notabenoid-dockerfile","full_name":"igormukhin/notabenoid-dockerfile","owner":{"login":"igormukhin","id":618760,"avatar_url":"https://avatars.githubusercontent.com/u/618760?v=3","gravatar_id":"","url":"https://api.github.com/users/igormukhin","html_url":"https://github.com/igormukhin","followers_url":"https://api.github.com/users/igormukhin/followers","following_url":"https://api.github.com/users/igormukhin/following{/other_user}","gists_url":"https://api.github.com/users/igormukhin/gists{/gist_id}","starred_url":"https://api.github.com/users/igormukhin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igormukhin/subscriptions","organizations_url":"https://api.github.com/users/igormukhin/orgs","repos_url":"https://api.github.com/users/igormukhin/repos","events_url":"https://api.github.com/users/igormukhin/events{/privacy}","received_events_url":"https://api.github.com/users/igormukhin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/igormukhin/notabenoid-dockerfile","description":"Dockerfile for notabenoid/notabenoid","fork":true,"url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile","forks_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/forks","keys_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/teams","hooks_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/hooks","issue_events_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/issues/events{/number}","events_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/events","assignees_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/assignees{/user}","branches_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/branches{/branch}","tags_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/tags","blobs_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/git/refs{/sha}","trees_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/statuses/{sha}","languages_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/languages","stargazers_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/stargazers","contributors_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/contributors","subscribers_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/subscribers","subscription_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/subscription","commits_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/commits{/sha}","git_commits_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/git/commits{/sha}","comments_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/comments{/number}","issue_comment_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/issues/comments{/number}","contents_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/contents/{+path}","compare_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/merges","archive_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/downloads","issues_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/issues{/number}","pulls_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/pulls{/number}","milestones_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/milestones{/number}","notifications_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/labels{/name}","releases_url":"https://api.github.com/repos/igormukhin/notabenoid-dockerfile/releases{/id}","created_at":"2015-09-06T15:40:48Z","updated_at":"2015-09-08T00:42:22Z","pushed_at":"2015-09-08T00:42:22Z","git_url":"git://github.com/igormukhin/notabenoid-dockerfile.git","ssh_url":"git@github.com:igormukhin/notabenoid-dockerfile.git","clone_url":"https://github.com/igormukhin/notabenoid-dockerfile.git","svn_url":"https://github.com/igormukhin/notabenoid-dockerfile","homepage":null,"size":160,"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":"notabenoid:master","ref":"master","sha":"45e901886f526cde4ca0775004dae635b59ef788","user":{"login":"notabenoid","id":12516022,"avatar_url":"https://avatars.githubusercontent.com/u/12516022?v=3","gravatar_id":"","url":"https://api.github.com/users/notabenoid","html_url":"https://github.com/notabenoid","followers_url":"https://api.github.com/users/notabenoid/followers","following_url":"https://api.github.com/users/notabenoid/following{/other_user}","gists_url":"https://api.github.com/users/notabenoid/gists{/gist_id}","starred_url":"https://api.github.com/users/notabenoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notabenoid/subscriptions","organizations_url":"https://api.github.com/users/notabenoid/orgs","repos_url":"https://api.github.com/users/notabenoid/repos","events_url":"https://api.github.com/users/notabenoid/events{/privacy}","received_events_url":"https://api.github.com/users/notabenoid/received_events","type":"Organization","site_admin":false},"repo":{"id":35896342,"name":"notabenoid-dockerfile","full_name":"notabenoid/notabenoid-dockerfile","owner":{"login":"notabenoid","id":12516022,"avatar_url":"https://avatars.githubusercontent.com/u/12516022?v=3","gravatar_id":"","url":"https://api.github.com/users/notabenoid","html_url":"https://github.com/notabenoid","followers_url":"https://api.github.com/users/notabenoid/followers","following_url":"https://api.github.com/users/notabenoid/following{/other_user}","gists_url":"https://api.github.com/users/notabenoid/gists{/gist_id}","starred_url":"https://api.github.com/users/notabenoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notabenoid/subscriptions","organizations_url":"https://api.github.com/users/notabenoid/orgs","repos_url":"https://api.github.com/users/notabenoid/repos","events_url":"https://api.github.com/users/notabenoid/events{/privacy}","received_events_url":"https://api.github.com/users/notabenoid/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/notabenoid/notabenoid-dockerfile","description":"Dockerfile for notabenoid/notabenoid","fork":false,"url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile","forks_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/forks","keys_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/teams","hooks_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/hooks","issue_events_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/issues/events{/number}","events_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/events","assignees_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/assignees{/user}","branches_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/branches{/branch}","tags_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/tags","blobs_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/git/refs{/sha}","trees_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/statuses/{sha}","languages_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/languages","stargazers_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/stargazers","contributors_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/contributors","subscribers_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/subscribers","subscription_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/subscription","commits_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/commits{/sha}","git_commits_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/git/commits{/sha}","comments_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/comments{/number}","issue_comment_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/issues/comments{/number}","contents_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/contents/{+path}","compare_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/merges","archive_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/downloads","issues_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/issues{/number}","pulls_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls{/number}","milestones_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/milestones{/number}","notifications_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/labels{/name}","releases_url":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/releases{/id}","created_at":"2015-05-19T17:04:00Z","updated_at":"2015-09-03T12:31:09Z","pushed_at":"2015-09-08T00:47:06Z","git_url":"git://github.com/notabenoid/notabenoid-dockerfile.git","ssh_url":"git@github.com:notabenoid/notabenoid-dockerfile.git","clone_url":"https://github.com/notabenoid/notabenoid-dockerfile.git","svn_url":"https://github.com/notabenoid/notabenoid-dockerfile","homepage":null,"size":160,"stargazers_count":1,"watchers_count":1,"language":"Nginx","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/2"},"html":{"href":"https://github.com/notabenoid/notabenoid-dockerfile/pull/2"},"issue":{"href":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/issues/2"},"comments":{"href":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/notabenoid/notabenoid-dockerfile/statuses/b1a9ebea7901fb3c7a3582d30e47027ab190ed2a"}}}}