From 62e0f0443c8612167a0e83fed9d8720b396ae0c6 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 13 Oct 2016 12:06:30 +0800 Subject: [PATCH 1/3] Support Yarn MANAGEMENT tool. Signed-off-by: Bo-Yi Wu --- docker-compose.yml | 1 + workspace/Dockerfile | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 35b901a..bb00811 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/workspace/Dockerfile b/workspace/Dockerfile index 2436585..7bf9494 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: ##################################### From 8544de7ea1db81be600691c02fbd60e423c36b36 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 13 Oct 2016 14:48:00 +0800 Subject: [PATCH 2/3] update readme. Signed-off-by: Bo-Yi Wu --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 5560609..1ef5ff7 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 From c9415b12c06d7e6048895ffd622788804ff81264 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 14 Oct 2016 09:01:50 +0800 Subject: [PATCH 3/3] Add YARN flag in production mode.. Signed-off-by: Bo-Yi Wu --- production-docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/production-docker-compose.yml b/production-docker-compose.yml index 15781f1..7bf4ae8 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