add Node Version Manager (nvm)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
8d216f83d5
commit
4922c5fafd
@ -46,25 +46,11 @@ RUN apt-get update && apt-get install -y --force-yes \
|
|||||||
git \
|
git \
|
||||||
curl \
|
curl \
|
||||||
vim \
|
vim \
|
||||||
nano \
|
nano
|
||||||
nodejs \
|
|
||||||
nodejs-dev \
|
|
||||||
npm
|
|
||||||
|
|
||||||
# Clean up, to free some space
|
# Clean up, to free some space
|
||||||
RUN apt-get clean
|
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
|
# Add an alias for PHPUnit
|
||||||
RUN echo "alias phpunit='./vendor/bin/phpunit'" >> ~/.bashrc
|
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 pecl install mongodb
|
||||||
RUN echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini
|
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
|
# Source the bash
|
||||||
RUN . ~/.bashrc
|
RUN . ~/.bashrc
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user