@@ -59,44 +59,71 @@ RUN apt-get update && \
59
59
nano \
60
60
&& apt-get clean
61
61
62
- # Composer: Install composer and add its bin to the PATH.
62
+ # ####################################
63
+ # Composer:
64
+ # ####################################
65
+
66
+ # Install composer and add its bin to the PATH.
63
67
RUN curl -s http://getcomposer.org/installer | php && \
64
68
echo "export PATH=${PATH}:/var/www/laravel/vendor/bin" >> ~/.bashrc && \
65
69
mv composer.phar /usr/local/bin/composer
66
70
67
- ARG INSTALL_PRESTISSIMO=true
68
- ENV INSTALL_PRESTISSIMO ${INSTALL_PRESTISSIMO}
71
+ # Add the composer.json
72
+ ADD ./composer.json /root/.composer/composer.json
73
+
74
+ # Check if global install need to be runned
75
+ ARG COMPOSER_GLOBAL_INSTALL=true
76
+ ENV COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL}
69
77
RUN if [ ${INSTALL_PRESTISSIMO} = true ]; then \
70
- # Prestissimo: Install Prestissimo (A Composer parallel install plugin)
71
- composer global require "hirak/prestissimo:^0.3" \
78
+ # run the install
79
+ composer global install \
72
80
;fi
73
81
82
+
83
+ # ####################################
84
+ # MongoDB:
85
+ # ####################################
86
+
87
+ # Check if Mongo needs to be installed
74
88
ARG INSTALL_MONGO=true
75
89
ENV INSTALL_MONGO ${INSTALL_MONGO}
76
90
RUN if [ ${INSTALL_MONGO} = true ]; then \
77
- # MongoDB: Install the mongodb extension
91
+ # Install the mongodb extension
78
92
pecl install mongodb && \
79
- echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini \
93
+ echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini \
80
94
;fi
81
95
96
+ # ####################################
97
+ # xDebug:
98
+ # ####################################
99
+
100
+ # Check if xDebug needs to be installed
82
101
ARG INSTALL_XDEBUG=true
83
102
ENV INSTALL_XDEBUG ${INSTALL_XDEBUG}
84
103
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
85
- # XDebug: Load the xdebug extension only with phpunit commands
104
+ # Load the xdebug extension only with phpunit commands
86
105
apt-get install -y --force-yes php7.0-xdebug && \
87
- sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \
88
- echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc \
106
+ sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \
107
+ echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc \
89
108
;fi
90
109
110
+ # ####################################
111
+ # Node / NVM:
112
+ # ####################################
113
+
114
+ # Check if NVM needs to be installed
91
115
ARG INSTALL_NODE=true
92
116
ENV INSTALL_NODE ${INSTALL_NODE}
93
117
RUN if [ ${INSTALL_NODE} = true ]; then \
94
- # Node: Install nvm (A Node Version Manager) and use it to install NodeJS
118
+ # Install nvm (A Node Version Manager)
95
119
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash \
96
120
;fi
121
+ # Again check if NVM needs to be installed
122
+ # I had to split this condifiton link this because when I get it inside the above if statment is refuses to work!
97
123
ENV if [ ${INSTALL_NODE} = true ]; then \
98
- # I had to split this condifiton link this because when I get it inside the above if statment is refuses to work!
124
+ # Set the ENV
99
125
NVM_DIR=/root/.nvm \
126
+ # Install NodeJS with NVM
100
127
RUN . ~/.nvm/nvm.sh && \
101
128
nvm install stable && \
102
129
nvm use stable && \
0 commit comments