|
| 1 | +FROM phusion/baseimage:0.9.16 |
| 2 | + |
| 3 | +# Forked from: https://github.com/fideloper/docker-nginx-php |
| 4 | +# Other components and inspiration from: https://github.com/dmyers/docker-laravel |
| 5 | + |
| 6 | +ENV HOME /root |
| 7 | + |
| 8 | +RUN /etc/my_init.d/00_regen_ssh_host_keys.sh |
| 9 | + |
| 10 | +CMD ["/sbin/my_init"] |
| 11 | + |
| 12 | +# Nginx-PHP Installation |
| 13 | +RUN apt-get update -y && apt-get install -y vim curl wget build-essential python-software-properties git-core |
| 14 | +RUN apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 4F4EA0AAE5267A6C |
| 15 | +RUN add-apt-repository -y ppa:ondrej/php5-5.6 && add-apt-repository -y ppa:nginx/stable && add-apt-repository ppa:chris-lea/node.js |
| 16 | +RUN apt-get update -y && sudo apt-get upgrade -y && apt-get install -y php5 php5-cli php5-fpm php5-mysql php5-curl \ |
| 17 | + php5-gd php5-mcrypt php5-intl php5-imap php5-tidy php-pear php5-xmlrpc \ |
| 18 | + nodejs |
| 19 | + |
| 20 | +# Install nginx |
| 21 | +RUN apt-get install -y nginx |
| 22 | + |
| 23 | +# Add build script |
| 24 | +RUN mkdir -p /root/setup |
| 25 | +ADD build/setup.sh /root/setup/setup.sh |
| 26 | +RUN chmod +x /root/setup/setup.sh |
| 27 | +RUN (cd /root/setup/; /root/setup/setup.sh) |
| 28 | + |
| 29 | +# Copy files from repo |
| 30 | +ADD build/default /etc/nginx/sites-available/default |
| 31 | + |
| 32 | +# Add all required files and folders, update permissions |
| 33 | +ADD build/nginx.sh /etc/service/nginx/run |
| 34 | +RUN chmod +x /etc/service/nginx/run |
| 35 | + |
| 36 | +ADD build/phpfpm.sh /etc/service/phpfpm/run |
| 37 | +RUN chmod +x /etc/service/phpfpm/run |
| 38 | + |
| 39 | +RUN chown -R www-data:www-data /var/www |
| 40 | +RUN chmod -R 755 /var/www |
| 41 | +RUN chown www-data:www-data -R /var/www/app/storage |
| 42 | + |
| 43 | +EXPOSE 80 |
| 44 | +VOLUME /var/www |
| 45 | + |
| 46 | +# Cleanup apt and lists |
| 47 | +RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
0 commit comments