{"sha":"f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","node_id":"MDY6Q29tbWl0Mjk3OTY0OTA6ZjkzZWQxZDM0ZjBiZTdiMjIyMmJkZmU2ZmNmYjcxNmI1OTBmNzU5Mw==","commit":{"author":{"name":"palewire","email":"ben.welsh@gmail.com","date":"2015-01-25T01:27:52Z"},"committer":{"name":"palewire","email":"ben.welsh@gmail.com","date":"2015-01-25T01:27:52Z"},"message":"Refactored boot to use the my_init feature of phusion:base_image","tree":{"sha":"b3356be9ea53ba3134f7f78a9d04c7c812c3d64b","url":"https://api.github.com/repos/palewire/django-calaccess-docker/git/trees/b3356be9ea53ba3134f7f78a9d04c7c812c3d64b"},"url":"https://api.github.com/repos/palewire/django-calaccess-docker/git/commits/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null}},"url":"https://api.github.com/repos/palewire/django-calaccess-docker/commits/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","html_url":"https://github.com/palewire/django-calaccess-docker/commit/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","comments_url":"https://api.github.com/repos/palewire/django-calaccess-docker/commits/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/comments","author":{"login":"palewire","id":9993,"node_id":"MDQ6VXNlcjk5OTM=","avatar_url":"https://avatars.githubusercontent.com/u/9993?v=4","gravatar_id":"","url":"https://api.github.com/users/palewire","html_url":"https://github.com/palewire","followers_url":"https://api.github.com/users/palewire/followers","following_url":"https://api.github.com/users/palewire/following{/other_user}","gists_url":"https://api.github.com/users/palewire/gists{/gist_id}","starred_url":"https://api.github.com/users/palewire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palewire/subscriptions","organizations_url":"https://api.github.com/users/palewire/orgs","repos_url":"https://api.github.com/users/palewire/repos","events_url":"https://api.github.com/users/palewire/events{/privacy}","received_events_url":"https://api.github.com/users/palewire/received_events","type":"User","site_admin":false},"committer":{"login":"palewire","id":9993,"node_id":"MDQ6VXNlcjk5OTM=","avatar_url":"https://avatars.githubusercontent.com/u/9993?v=4","gravatar_id":"","url":"https://api.github.com/users/palewire","html_url":"https://github.com/palewire","followers_url":"https://api.github.com/users/palewire/followers","following_url":"https://api.github.com/users/palewire/following{/other_user}","gists_url":"https://api.github.com/users/palewire/gists{/gist_id}","starred_url":"https://api.github.com/users/palewire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palewire/subscriptions","organizations_url":"https://api.github.com/users/palewire/orgs","repos_url":"https://api.github.com/users/palewire/repos","events_url":"https://api.github.com/users/palewire/events{/privacy}","received_events_url":"https://api.github.com/users/palewire/received_events","type":"User","site_admin":false},"parents":[{"sha":"d48275780e6282192e91fa8d95e49df68f3f3653","url":"https://api.github.com/repos/palewire/django-calaccess-docker/commits/d48275780e6282192e91fa8d95e49df68f3f3653","html_url":"https://github.com/palewire/django-calaccess-docker/commit/d48275780e6282192e91fa8d95e49df68f3f3653"}],"stats":{"total":131,"additions":62,"deletions":69},"files":[{"sha":"f4af2db8fe49a9815c3a43cc991fc4809768eb39","filename":"0.1/000-default.conf","status":"added","additions":6,"deletions":0,"changes":6,"blob_url":"https://github.com/palewire/django-calaccess-docker/blob/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2F000-default.conf","raw_url":"https://github.com/palewire/django-calaccess-docker/raw/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2F000-default.conf","contents_url":"https://api.github.com/repos/palewire/django-calaccess-docker/contents/0.1%2F000-default.conf?ref=f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","patch":"@@ -0,0 +1,6 @@\n+\n+ WSGIScriptAlias / /apps/calaccess/code/project/wsgi.py\n+ WSGIDaemonProcess calaccess user=ccdc python-path=/apps/calaccess/code:/apps/calaccess/lib/python2.7/site-packages display-name=%{GROUP} processes=2 threads=15\n+ WSGIProcessGroup calaccess\n+ WSGIApplicationGroup %{GLOBAL}\n+"},{"sha":"53d6984dc9d180821358825cff996950d0ae9a35","filename":"0.1/01_run_apache.sh","status":"added","additions":5,"deletions":0,"changes":5,"blob_url":"https://github.com/palewire/django-calaccess-docker/blob/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2F01_run_apache.sh","raw_url":"https://github.com/palewire/django-calaccess-docker/raw/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2F01_run_apache.sh","contents_url":"https://api.github.com/repos/palewire/django-calaccess-docker/contents/0.1%2F01_run_apache.sh?ref=f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","patch":"@@ -0,0 +1,5 @@\n+#!/bin/bash\n+set -e\n+chown ccdc:ccdc /apps/ -R\n+source /etc/apache2/envvars\n+service apache2 restart"},{"sha":"124028fb289226a0a6744a44067dc0c29f163555","filename":"0.1/02_run_mysql.sh","status":"added","additions":2,"deletions":0,"changes":2,"blob_url":"https://github.com/palewire/django-calaccess-docker/blob/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2F02_run_mysql.sh","raw_url":"https://github.com/palewire/django-calaccess-docker/raw/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2F02_run_mysql.sh","contents_url":"https://api.github.com/repos/palewire/django-calaccess-docker/contents/0.1%2F02_run_mysql.sh?ref=f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","patch":"@@ -0,0 +1,2 @@\n+#!/bin/bash\n+service mysql restart;"},{"sha":"9df7c8c7b166d2b5471a0fd8e85d9df00d16de94","filename":"0.1/03_configure_mysql.sh","status":"added","additions":4,"deletions":0,"changes":4,"blob_url":"https://github.com/palewire/django-calaccess-docker/blob/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2F03_configure_mysql.sh","raw_url":"https://github.com/palewire/django-calaccess-docker/raw/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2F03_configure_mysql.sh","contents_url":"https://api.github.com/repos/palewire/django-calaccess-docker/contents/0.1%2F03_configure_mysql.sh?ref=f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","patch":"@@ -0,0 +1,4 @@\n+#!/bin/bash\n+set -e\n+mysql -uroot -e \"GRANT ALL PRIVILEGES ON *.* TO $MYSQL_USER@'%' IDENTIFIED BY '$MYSQL_PASSWORD'\";\n+mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -e \"create database $MYSQL_DATABASE\";"},{"sha":"eae99db99ddd648e40e0c94734ef7c1d268cf2c8","filename":"0.1/04_configure_django.sh","status":"added","additions":2,"deletions":0,"changes":2,"blob_url":"https://github.com/palewire/django-calaccess-docker/blob/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2F04_configure_django.sh","raw_url":"https://github.com/palewire/django-calaccess-docker/raw/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2F04_configure_django.sh","contents_url":"https://api.github.com/repos/palewire/django-calaccess-docker/contents/0.1%2F04_configure_django.sh?ref=f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","patch":"@@ -0,0 +1,2 @@\n+#!/bin/bash\n+/apps/calaccess/bin/python /apps/calaccess/code/manage.py migrate;"},{"sha":"6454dc89d55606c61ecb6b0ec03fa7be0106f669","filename":"0.1/Dockerfile","status":"modified","additions":10,"deletions":10,"changes":20,"blob_url":"https://github.com/palewire/django-calaccess-docker/blob/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2FDockerfile","raw_url":"https://github.com/palewire/django-calaccess-docker/raw/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2FDockerfile","contents_url":"https://api.github.com/repos/palewire/django-calaccess-docker/contents/0.1%2FDockerfile?ref=f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","patch":"@@ -59,14 +59,14 @@ RUN /apps/calaccess/bin/pip install -r /apps/calaccess/code/requirements.txt\n # Clean up apt when done.\n RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\n \n-# Boot up MySQL\n-COPY entrypoint-mysql.sh /entrypoint-mysql.sh\n-RUN chmod 755 /entrypoint-mysql.sh\n-ENTRYPOINT [\"/entrypoint-mysql.sh\"]\n-CMD [\"mysqld\"]\n-\n-# Boot up Apache\n+# Configure Apache\n EXPOSE 80\n-ADD run-apache.sh /run-apache.sh\n-RUN chmod 755 /run-apache.sh\n-CMD [\"/run-apache.sh\"]\n+COPY 000-default.conf /etc/apache2/sites-enabled/000-default.conf\n+COPY apache2.conf /etc/apache2/apache2.conf\n+\n+RUN mkdir -p /etc/my_init.d\n+ADD 01_run_apache.sh /etc/my_init.d/01_run_apache.sh\n+ADD 02_run_mysql.sh /etc/my_init.d/02_run_mysql.sh\n+ADD 03_configure_mysql.sh /etc/my_init.d/03_configure_mysql.sh\n+ADD 04_configure_django.sh /etc/my_init.d/04_configure_django.sh\n+RUN chmod 755 /etc/my_init.d/*.sh"},{"sha":"fe75386b760aebebd5f1e75af068b32bf349026e","filename":"0.1/apache2.conf","status":"added","additions":31,"deletions":0,"changes":31,"blob_url":"https://github.com/palewire/django-calaccess-docker/blob/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2Fapache2.conf","raw_url":"https://github.com/palewire/django-calaccess-docker/raw/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/0.1%2Fapache2.conf","contents_url":"https://api.github.com/repos/palewire/django-calaccess-docker/contents/0.1%2Fapache2.conf?ref=f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","patch":"@@ -0,0 +1,31 @@\n+ServerName datadesk\n+PidFile ${APACHE_PID_FILE}\n+Timeout 60\n+KeepAlive Off\n+StartServers 2\n+MinSpareThreads 2\n+MaxSpareThreads 4 \n+ThreadLimit 10\n+ThreadsPerChild 10\n+MaxClients 160\n+MaxRequestsPerChild 10000\n+User ${APACHE_RUN_USER}\n+Group ${APACHE_RUN_GROUP}\n+AccessFileName .htaccess\n+\n+ Order allow,deny\n+ Deny from all\n+ Satisfy all\n+\n+HostnameLookups Off\n+ErrorLog ${APACHE_LOG_DIR}/error.log\n+LogLevel warn\n+Include mods-enabled/*.load\n+Include mods-enabled/*.conf\n+Include ports.conf\n+LogFormat \"%v:%p %h %l %u %t \\\"%r\\\" %>s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" vhost_combined\n+LogFormat \"%h %l %u %t \\\"%r\\\" %>s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" combined\n+LogFormat \"%h %l %u %t \\\"%r\\\" %>s %O\" common\n+LogFormat \"%{Referer}i -> %U\" referer\n+LogFormat \"%{User-agent}i\" agent\n+Include sites-enabled/"},{"sha":"86fbbf310027aa370b365df1f8cf1c343665fab4","filename":"0.1/entrypoint-mysql.sh","status":"removed","additions":0,"deletions":52,"changes":52,"blob_url":"https://github.com/palewire/django-calaccess-docker/blob/d48275780e6282192e91fa8d95e49df68f3f3653/0.1%2Fentrypoint-mysql.sh","raw_url":"https://github.com/palewire/django-calaccess-docker/raw/d48275780e6282192e91fa8d95e49df68f3f3653/0.1%2Fentrypoint-mysql.sh","contents_url":"https://api.github.com/repos/palewire/django-calaccess-docker/contents/0.1%2Fentrypoint-mysql.sh?ref=d48275780e6282192e91fa8d95e49df68f3f3653","patch":"@@ -1,52 +0,0 @@\n-#!/bin/bash\n-set -e\n-\n-# TODO read this from the MySQL config?\n-DATADIR='/var/lib/mysql'\n-\n-if [ \"${1:0:1}\" = '-' ]; then\n-\tset -- mysqld \"$@\"\n-fi\n-\n-if [ ! -d \"$DATADIR/mysql\" -a \"${1%_safe}\" = 'mysqld' ]; then\n-\tif [ -z \"$MYSQL_ROOT_PASSWORD\" -a -z \"$MYSQL_ALLOW_EMPTY_PASSWORD\" ]; then\n-\t\techo >&2 'error: database is uninitialized and MYSQL_ROOT_PASSWORD not set'\n-\t\techo >&2 ' Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?'\n-\t\texit 1\n-\tfi\n-\t\n-\techo 'Running mysql_install_db ...'\n-\tmysql_install_db --datadir=\"$DATADIR\" --mysqld-file=\"$(which mysqld)\"\n-\techo 'Finished mysql_install_db'\n-\t\n-\t# These statements _must_ be on individual lines, and _must_ end with\n-\t# semicolons (no line breaks or comments are permitted).\n-\t# TODO proper SQL escaping on ALL the things D:\n-\t\n-\ttempSqlFile='/tmp/mysql-first-time.sql'\n-\tcat > \"$tempSqlFile\" <<-EOSQL\n-\t\tDELETE FROM mysql.user ;\n-\t\tCREATE USER 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' ;\n-\t\tGRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ;\n-\t\tDROP DATABASE IF EXISTS test ;\n-\tEOSQL\n-\t\n-\tif [ \"$MYSQL_DATABASE\" ]; then\n-\t\techo \"CREATE DATABASE IF NOT EXISTS \\`$MYSQL_DATABASE\\` ;\" >> \"$tempSqlFile\"\n-\tfi\n-\t\n-\tif [ \"$MYSQL_USER\" -a \"$MYSQL_PASSWORD\" ]; then\n-\t\techo \"CREATE USER '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD' ;\" >> \"$tempSqlFile\"\n-\t\t\n-\t\tif [ \"$MYSQL_DATABASE\" ]; then\n-\t\t\techo \"GRANT ALL ON \\`$MYSQL_DATABASE\\`.* TO '$MYSQL_USER'@'%' ;\" >> \"$tempSqlFile\"\n-\t\tfi\n-\tfi\n-\t\n-\techo 'FLUSH PRIVILEGES ;' >> \"$tempSqlFile\"\n-\t\n-\tset -- \"$@\" --init-file=\"$tempSqlFile\"\n-fi\n-\n-chown -R mysql:mysql \"$DATADIR\"\n-exec \"$@\""},{"sha":"c19b96068389d138b29d55c21e5b724f6f2dc03e","filename":"0.1/run-apache.sh","status":"removed","additions":0,"deletions":4,"changes":4,"blob_url":"https://github.com/palewire/django-calaccess-docker/blob/d48275780e6282192e91fa8d95e49df68f3f3653/0.1%2Frun-apache.sh","raw_url":"https://github.com/palewire/django-calaccess-docker/raw/d48275780e6282192e91fa8d95e49df68f3f3653/0.1%2Frun-apache.sh","contents_url":"https://api.github.com/repos/palewire/django-calaccess-docker/contents/0.1%2Frun-apache.sh?ref=d48275780e6282192e91fa8d95e49df68f3f3653","patch":"@@ -1,4 +0,0 @@\n-#!/bin/bash\n-chown www-data:www-data /apps/ -R\n-source /etc/apache2/envvars\n-exec apache2 -D FOREGROUND"},{"sha":"8e202d831f19a22f535619e96275b062b0451fa5","filename":"Makefile","status":"modified","additions":2,"deletions":2,"changes":4,"blob_url":"https://github.com/palewire/django-calaccess-docker/blob/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/Makefile","raw_url":"https://github.com/palewire/django-calaccess-docker/raw/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/Makefile","contents_url":"https://api.github.com/repos/palewire/django-calaccess-docker/contents/Makefile?ref=f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","patch":"@@ -5,9 +5,8 @@ image:\n \n container:\n \tsudo docker run \\\n-\t\t-p 127.0.0.1:8080:80 \\\n+\t\t-p 127.0.0.1:80:80 \\\n \t\t--name test-calaccess \\\n-\t\t-e MYSQL_ROOT_PASSWORD=mysecretpassword \\\n \t\t-e MYSQL_DATABASE=ccdc \\\n \t\t-e MYSQL_USER=ccdc \\\n \t\t-e MYSQL_PASSWORD=ccdc \\\n@@ -18,3 +17,4 @@ test:\n \tsudo docker rm test-calaccess\n \tmake image\n \tmake container\n+\tsudo docker logs test-calaccess"},{"sha":"252c4ef1bcb85e1db9f1b41238dde9d349cee69a","filename":"README.md","status":"modified","additions":0,"deletions":1,"changes":1,"blob_url":"https://github.com/palewire/django-calaccess-docker/blob/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/README.md","raw_url":"https://github.com/palewire/django-calaccess-docker/raw/f93ed1d34f0be7b2222bdfe6fcfb716b590f7593/README.md","contents_url":"https://api.github.com/repos/palewire/django-calaccess-docker/contents/README.md?ref=f93ed1d34f0be7b2222bdfe6fcfb716b590f7593","patch":"@@ -14,7 +14,6 @@ $ sudo docker build -t django-calaccess .\n $ sudo docker run \\\n -p 127.0.0.1:8080:80 \\\n --name test-calaccess \\\n- -e MYSQL_ROOT_PASSWORD=mysecretpassword \\\n -e MYSQL_DATABASE=ccdc \\\n -e MYSQL_USER=ccdc \\\n -e MYSQL_PASSWORD=ccdc \\"}]}