[
  {
    "path": ".gitignore",
    "content": ".DS_Store\n._*\n.vagrant\n"
  },
  {
    "path": "Dockerfile",
    "content": "FROM phusion/baseimage:0.9.15\n\n# Ensure UTF-8\nRUN locale-gen en_US.UTF-8\nENV LANG       en_US.UTF-8\nENV LC_ALL     en_US.UTF-8\n\nENV HOME /root\n\nRUN /etc/my_init.d/00_regen_ssh_host_keys.sh\n\nCMD [\"/sbin/my_init\"]\n\n# Nginx-PHP Installation\nRUN apt-get update\nRUN DEBIAN_FRONTEND=\"noninteractive\" apt-get install -y vim curl wget build-essential python-software-properties\nRUN add-apt-repository -y ppa:ondrej/php5\nRUN add-apt-repository -y ppa:nginx/stable\nRUN apt-get update\nRUN DEBIAN_FRONTEND=\"noninteractive\" apt-get install -y --force-yes php5-cli php5-fpm php5-mysql php5-pgsql php5-sqlite php5-curl\\\n\t\t       php5-gd php5-mcrypt php5-intl php5-imap php5-tidy\n\nRUN sed -i \"s/;date.timezone =.*/date.timezone = UTC/\" /etc/php5/fpm/php.ini\nRUN sed -i \"s/;date.timezone =.*/date.timezone = UTC/\" /etc/php5/cli/php.ini\n\nRUN DEBIAN_FRONTEND=\"noninteractive\" apt-get install -y nginx\n\nRUN echo \"daemon off;\" >> /etc/nginx/nginx.conf\nRUN sed -i -e \"s/;daemonize\\s*=\\s*yes/daemonize = no/g\" /etc/php5/fpm/php-fpm.conf\nRUN sed -i \"s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/\" /etc/php5/fpm/php.ini\n \nRUN mkdir -p        /var/www\nADD build/default   /etc/nginx/sites-available/default\nRUN mkdir           /etc/service/nginx\nADD build/nginx.sh  /etc/service/nginx/run\nRUN chmod +x        /etc/service/nginx/run\nRUN mkdir           /etc/service/phpfpm\nADD build/phpfpm.sh /etc/service/phpfpm/run\nRUN chmod +x        /etc/service/phpfpm/run\n\nEXPOSE 80\n# End Nginx-PHP\n\nRUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\n"
  },
  {
    "path": "build/default",
    "content": "server {\n    listen  80;\n\n    root /var/www;\n    index index.html index.htm index.php;\n\n    # Make site accessible from http://set-ip-address.xip.io\n    server_name localhost;\n\n    access_log /var/log/nginx/localhost.com-access.log;\n    error_log  /var/log/nginx/localhost.com-error.log error;\n\n    charset utf-8;\n\n    location / {\n        try_files $uri $uri/ /index.html /index.php?$query_string;\n    }\n\n    location = /favicon.ico { log_not_found off; access_log off; }\n    location = /robots.txt  { access_log off; log_not_found off; }\n\n    error_page 404 /index.php;\n\n    # pass the PHP scripts to php5-fpm\n    # Note: \\.php$ is susceptible to file upload attacks\n    # Consider using: \"location ~ ^/(index|app|app_dev|config)\\.php(/|$) {\"\n    location ~ \\.php$ {\n        fastcgi_split_path_info ^(.+\\.php)(/.+)$;\n        # With php5-fpm:\n        fastcgi_pass unix:/var/run/php5-fpm.sock;\n        fastcgi_index index.php;\n        include fastcgi_params;\n        include fastcgi.conf;\n        fastcgi_param LARA_ENV local; # Environment variable for Laravel\n        fastcgi_param HTTPS off;\n    }\n\n    # Deny .htaccess file access\n    location ~ /\\.ht {\n        deny all;\n    }\n}\n"
  },
  {
    "path": "build/nginx.sh",
    "content": "#!/usr/bin/env bash\n\nnginx\n"
  },
  {
    "path": "build/phpfpm.sh",
    "content": "#!/usr/bin/env bash\n\nphp5-fpm -c /etc/php5/fpm\n"
  },
  {
    "path": "readme.md",
    "content": "# Docker: Ubuntu, Nginx and PHP Stack\n\nThis is the basis for LEMP stack (minus MySQL). This is based on [phusion/baseimage-docker](https://github.com/phusion/baseimage-docker) base Ubuntu image, which takes care of system issues which Docker's base Ubuntu image does not take care of, such as watching processes, logrotate, ssh server, cron and syslog-ng.\n\nYou can build this yourself after cloning the project (assuming you have Docker installed).\n\n```bash\ncd /path/to/repo/docker-nginx-php\ndocker build -t webapp . # Build a Docker image named \"webapp\" from this location \".\"\n# wait for it to build...\n\n# Run the docker container\ndocker run -v /path/to/local/web/files:/var/www:rw -p 80:80 -d webapp /sbin/my_init --enable-insecure-key\n```\n\nThis will bind local port 80 to the container's port 80. This means you should be able to go to \"localhost\" in your browser (or the IP address of your virtual machine oh which Docker is running) and see your web application files.\n\n* `docker run` - starts a new docker container\n* `-v /path/to/local/web/files:/var/www:rw` - Bind a local directory to a directory in the container for file sharing. `rw` makes it \"read-write\", so the container can write to the directory.\n* `-p 80:80` - Binds the local port 80 to the container's port 80, so local web requests are handled by the docker.\n* `-d webapp` - Use the image tagged \"webapp\"\n* `/sbin/my_init` - Run the init scripts used to kick off long-running processes and other bootstrapping, as per [phusion/baseimage-docker](https://github.com/phusion/baseimage-docker)\n* `--enable-insecure-key` - Enable a generated SSL key so you can SSH into the container, again as per [phusion/baseimage-docker](https://github.com/phusion/baseimage-docker). Generate your own SSH key for production use.\n* If you use this with [fideloper/docker-mysql](https://github.com/fideloper/docker-mysql), then [link this container](http://docs.docker.io/en/latest/use/working_with_links_names/) with MySQL's (after running the MySQL container first) via `-link mysql:db`\n"
  },
  {
    "path": "www/.gitignore",
    "content": "*\n!.gitignore\n"
  }
]