diff --git a/README.md b/README.md index 55606093..1ef5ff75 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant. - [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install) - [Install Prestissimo](#Install-Prestissimo) - [Install Node + NVM](#Install-Node) + - [Install Node + YARN](#Install-Yarn) - [Debugging](#debugging) - [Upgrading LaraDock](#upgrading-laradock) - [Help & Questions](#Help) @@ -1125,6 +1126,30 @@ It should be like this: 3 - Re-build the container `docker-compose build workspace` +
+ +### Install Node + YARN + +Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find [here](http://yarnpkg.com/en/compare).To install NodeJS and [Yarn](https://yarnpkg.com/) in the Workspace container: + +1 - Open the `docker-compose.yml` file + +2 - Search for the `INSTALL_NODE` and `INSTALL_YARN` argument under the Workspace Container and set it to `true` + +It should be like this: + +```yml + workspace: + build: + context: ./workspace + args: + - INSTALL_NODE=true + - INSTALL_YARN=true + ... +``` + +3 - Re-build the container `docker-compose build workspace` +
### Install Aerospike extension diff --git a/docker-compose.yml b/docker-compose.yml index 35b901ad..bb00811c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: - INSTALL_XDEBUG=false - INSTALL_MONGO=false - INSTALL_NODE=false + - INSTALL_YARN=false - INSTALL_DRUSH=false - INSTALL_AEROSPIKE_EXTENSION=false - COMPOSER_GLOBAL_INSTALL=false diff --git a/production-docker-compose.yml b/production-docker-compose.yml index 15781f16..7bf4ae84 100644 --- a/production-docker-compose.yml +++ b/production-docker-compose.yml @@ -11,6 +11,7 @@ services: - INSTALL_XDEBUG=false - INSTALL_MONGO=false - INSTALL_NODE=false + - INSTALL_YARN=false - INSTALL_DRUSH=false - INSTALL_AEROSPIKE_EXTENSION=false - COMPOSER_GLOBAL_INSTALL=false diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 24365859..7bf9494a 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -181,6 +181,30 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +##################################### +# YARN: +##################################### + +USER laradock + +ARG INSTALL_YARN=false +ENV INSTALL_YARN ${INSTALL_YARN} + +RUN if [ ${INSTALL_YARN} = true ]; then \ + curl -o- -L https://yarnpkg.com/install.sh | bash && \ + echo "" >> ~/.bashrc && \ + echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \ +;fi + +# Add YARN binaries to root's .bashrc +USER root + +RUN if [ ${INSTALL_YARN} = true ]; then \ + echo "" >> ~/.bashrc && \ + echo 'export YARN_DIR="/home/laradock/.yarn"' >> ~/.bashrc && \ + echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc \ +;fi + ##################################### # PHP Aerospike: #####################################