{"action":"created","issue":{"url":"https://api.github.com/repos/meanbee/docker-magento/issues/9","repository_url":"https://api.github.com/repos/meanbee/docker-magento","labels_url":"https://api.github.com/repos/meanbee/docker-magento/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/meanbee/docker-magento/issues/9/comments","events_url":"https://api.github.com/repos/meanbee/docker-magento/issues/9/events","html_url":"https://github.com/meanbee/docker-magento/issues/9","id":121496653,"number":9,"title":"Implement a solution for running the cron","user":{"login":"punkstar","id":179072,"avatar_url":"https://avatars.githubusercontent.com/u/179072?v=3","gravatar_id":"","url":"https://api.github.com/users/punkstar","html_url":"https://github.com/punkstar","followers_url":"https://api.github.com/users/punkstar/followers","following_url":"https://api.github.com/users/punkstar/following{/other_user}","gists_url":"https://api.github.com/users/punkstar/gists{/gist_id}","starred_url":"https://api.github.com/users/punkstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/punkstar/subscriptions","organizations_url":"https://api.github.com/users/punkstar/orgs","repos_url":"https://api.github.com/users/punkstar/repos","events_url":"https://api.github.com/users/punkstar/events{/privacy}","received_events_url":"https://api.github.com/users/punkstar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/meanbee/docker-magento/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"tgerulaitis","id":613076,"avatar_url":"https://avatars.githubusercontent.com/u/613076?v=3","gravatar_id":"","url":"https://api.github.com/users/tgerulaitis","html_url":"https://github.com/tgerulaitis","followers_url":"https://api.github.com/users/tgerulaitis/followers","following_url":"https://api.github.com/users/tgerulaitis/following{/other_user}","gists_url":"https://api.github.com/users/tgerulaitis/gists{/gist_id}","starred_url":"https://api.github.com/users/tgerulaitis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgerulaitis/subscriptions","organizations_url":"https://api.github.com/users/tgerulaitis/orgs","repos_url":"https://api.github.com/users/tgerulaitis/repos","events_url":"https://api.github.com/users/tgerulaitis/events{/privacy}","received_events_url":"https://api.github.com/users/tgerulaitis/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-12-10T14:26:34Z","updated_at":"2016-02-10T16:06:28Z","closed_at":null,"body":"We need to consider how we are going to run the cron in this environment.  I see three approaches:\r\n\r\n* Add a `crontab` entry in the `apache` image that runs `cron.sh`\r\n* Rely on the host machine to run a command like `docker-compose run tools bash /var/www/html/cron.sh` on a schedule\r\n* Add a new cron image which runs the cron in the foreground (somehow!) which runs as a permanent service (in the `docker-compose` sense)\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/meanbee/docker-magento/issues/comments/182448697","html_url":"https://github.com/meanbee/docker-magento/issues/9#issuecomment-182448697","issue_url":"https://api.github.com/repos/meanbee/docker-magento/issues/9","id":182448697,"user":{"login":"tgerulaitis","id":613076,"avatar_url":"https://avatars.githubusercontent.com/u/613076?v=3","gravatar_id":"","url":"https://api.github.com/users/tgerulaitis","html_url":"https://github.com/tgerulaitis","followers_url":"https://api.github.com/users/tgerulaitis/followers","following_url":"https://api.github.com/users/tgerulaitis/following{/other_user}","gists_url":"https://api.github.com/users/tgerulaitis/gists{/gist_id}","starred_url":"https://api.github.com/users/tgerulaitis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgerulaitis/subscriptions","organizations_url":"https://api.github.com/users/tgerulaitis/orgs","repos_url":"https://api.github.com/users/tgerulaitis/repos","events_url":"https://api.github.com/users/tgerulaitis/events{/privacy}","received_events_url":"https://api.github.com/users/tgerulaitis/received_events","type":"User","site_admin":false},"created_at":"2016-02-10T16:06:28Z","updated_at":"2016-02-10T16:06:28Z","body":"I attempted to create an image, based from the same templates as the php-cli images (except without debug), that would run cron in the foreground.\r\n\r\nThings I've learned from attempting to write a cron image based on the same templates as the php-cli images:\r\n\r\n1. You can not mount crontab entries. cron has very strict permissions for crontab files (owned by root, not writable by group), which causes problems when the files are mounted.\r\n2. The www-data user doesn't seem to have access to php. When I attempted to run the cron as www-data (which we need, otherwise cron could create files that the web server would not be able to read), cron was never executed, because `which php` in the `cron.sh` file returns an empty string.\r\n\r\nI don't have any more time to waste on this at the moment."}}