1+ #
2+ # --------------------------------------------------------------------------
3+ # Image Setup
4+ # --------------------------------------------------------------------------
5+ #
6+
17FROM phusion/baseimage:latest
28
39MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
@@ -11,6 +17,12 @@ ENV LC_CTYPE=UTF-8
1117ENV LANG=en_US.UTF-8
1218ENV TERM xterm
1319
20+ #
21+ # --------------------------------------------------------------------------
22+ # Software's Installation
23+ # --------------------------------------------------------------------------
24+ #
25+
1426# Install "software-properties-common" (for the "add-apt-repository")
1527RUN apt-get update && apt-get install -y \
1628 software-properties-common
@@ -19,7 +31,7 @@ RUN apt-get update && apt-get install -y \
1931RUN add-apt-repository -y \
2032 ppa:ondrej/php
2133
22- # Install PHP-CLI 7, some PHP extentions and some useful Tools with APT
34+ # Install " PHP-CLI 7", " PHP extentions", " useful Tools"
2335RUN apt-get update && apt-get install -y --force-yes \
2436 php7.0-cli \
2537 php7.0-common \
@@ -50,38 +62,45 @@ RUN apt-get update && apt-get install -y --force-yes \
5062 nano \
5163 pkg-config
5264
53- # Clean up, to free some space
65+ # Clean up now , to free up some space
5466RUN apt-get clean
5567
56- # remove load xdebug extension (only load on phpunit command)
57- RUN sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini
58-
59- # Add bin folder of composer to PATH.
60- RUN echo "export PATH=${PATH}:/var/www/laravel/vendor/bin" >> ~/.bashrc
61-
62- # Install Composer
68+ # Composer: Install composer and add its bin to the PATH.
6369RUN curl -s http://getcomposer.org/installer | php \
70+ && echo "export PATH=${PATH}:/var/www/laravel/vendor/bin" >> ~/.bashrc \
6471 && mv composer.phar /usr/local/bin/composer
6572
66- # Load xdebug Zend extension with phpunit command
67- RUN echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc
73+ # Prestissimo: Install Prestissimo (A Composer parallel install plugin)
74+ ARG INSTALL_PRESTISSIMO=false
75+ RUN if [ "$INSTALL_PRESTISSIMO" = true ] ; then \
76+ composer global require "hirak/prestissimo:^0.3" ; \
77+ fi
6878
69- # Install mongodb extension
70- RUN pecl install mongodb
71- RUN echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini
79+ # MongoDB: Install the mongodb extension
80+ RUN pecl install mongodb \
81+ && echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini
7282
73- # Install nvm (Node Version Manager)
74- RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
83+ # XDebug: Load the xdebug extension only with phpunit commands
84+ RUN sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini \
85+ && echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc
7586
87+ # NVM: Install nvm (A Node Version Manager)
88+ RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
7689ENV NVM_DIR=/root/.nvm
7790
78- # Install stable node
91+ # Node: Install node
7992RUN . ~/.nvm/nvm.sh \
8093 && nvm install stable \
8194 && nvm use stable \
8295 && nvm alias stable \
8396 && npm install -g gulp bower
8497
98+ #
99+ # --------------------------------------------------------------------------
100+ # Final Touch
101+ # --------------------------------------------------------------------------
102+ #
103+
85104# Source the bash
86105RUN . ~/.bashrc
87106
@@ -90,8 +109,3 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
90109
91110WORKDIR /var/www/laravel
92111
93- # Install optional software
94- ARG INSTALL_PRESTISSIMO=false
95- RUN if [ "$INSTALL_PRESTISSIMO" = true ] ; then \
96- composer global require "hirak/prestissimo:^0.3" ; \
97- fi
0 commit comments