add Node Version Manager (nvm)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
		@@ -46,25 +46,11 @@ RUN apt-get update && apt-get install -y --force-yes \
 | 
			
		||||
        git \
 | 
			
		||||
        curl \
 | 
			
		||||
        vim \
 | 
			
		||||
        nano \
 | 
			
		||||
        nodejs \
 | 
			
		||||
        nodejs-dev \
 | 
			
		||||
        npm
 | 
			
		||||
        nano
 | 
			
		||||
 | 
			
		||||
# Clean up, to free some space
 | 
			
		||||
RUN apt-get clean
 | 
			
		||||
 | 
			
		||||
# Install gulp and bower with NPM
 | 
			
		||||
RUN npm install -g \
 | 
			
		||||
    gulp \
 | 
			
		||||
    bower
 | 
			
		||||
 | 
			
		||||
# Link the global gulp to be used locally
 | 
			
		||||
RUN npm link gulp
 | 
			
		||||
 | 
			
		||||
# Add a symbolic link for Node
 | 
			
		||||
RUN ln -s /usr/bin/nodejs /usr/bin/node
 | 
			
		||||
 | 
			
		||||
# Add an alias for PHPUnit
 | 
			
		||||
RUN echo "alias phpunit='./vendor/bin/phpunit'" >> ~/.bashrc
 | 
			
		||||
 | 
			
		||||
@@ -77,6 +63,18 @@ RUN curl -s http://getcomposer.org/installer | php \
 | 
			
		||||
RUN pecl install mongodb
 | 
			
		||||
RUN echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini
 | 
			
		||||
 | 
			
		||||
# Install nvm (Node Version Manager)
 | 
			
		||||
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
 | 
			
		||||
 | 
			
		||||
ENV NVM_DIR=/root/.nvm
 | 
			
		||||
 | 
			
		||||
# Install stable node
 | 
			
		||||
RUN . ~/.nvm/nvm.sh \
 | 
			
		||||
    && nvm install stable \
 | 
			
		||||
    && nvm use stable \
 | 
			
		||||
    && nvm alias stable \
 | 
			
		||||
    && npm install -g gulp bower
 | 
			
		||||
 | 
			
		||||
# Source the bash
 | 
			
		||||
RUN . ~/.bashrc
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user