Merge pull request #361 from LaraDock/yarn
Support Yarn package manager for JavaScript
This commit is contained in:
commit
8d1ba2e802
25
README.md
25
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)
|
- [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install)
|
||||||
- [Install Prestissimo](#Install-Prestissimo)
|
- [Install Prestissimo](#Install-Prestissimo)
|
||||||
- [Install Node + NVM](#Install-Node)
|
- [Install Node + NVM](#Install-Node)
|
||||||
|
- [Install Node + YARN](#Install-Yarn)
|
||||||
- [Debugging](#debugging)
|
- [Debugging](#debugging)
|
||||||
- [Upgrading LaraDock](#upgrading-laradock)
|
- [Upgrading LaraDock](#upgrading-laradock)
|
||||||
- [Help & Questions](#Help)
|
- [Help & Questions](#Help)
|
||||||
@ -1125,6 +1126,30 @@ It should be like this:
|
|||||||
|
|
||||||
3 - Re-build the container `docker-compose build workspace`
|
3 - Re-build the container `docker-compose build workspace`
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<a name="Install-Yarn"></a>
|
||||||
|
### 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`
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="Install-Aerospike-Extension"></a>
|
<a name="Install-Aerospike-Extension"></a>
|
||||||
### Install Aerospike extension
|
### Install Aerospike extension
|
||||||
|
@ -11,6 +11,7 @@ services:
|
|||||||
- INSTALL_XDEBUG=false
|
- INSTALL_XDEBUG=false
|
||||||
- INSTALL_MONGO=false
|
- INSTALL_MONGO=false
|
||||||
- INSTALL_NODE=false
|
- INSTALL_NODE=false
|
||||||
|
- INSTALL_YARN=false
|
||||||
- INSTALL_DRUSH=false
|
- INSTALL_DRUSH=false
|
||||||
- INSTALL_AEROSPIKE_EXTENSION=false
|
- INSTALL_AEROSPIKE_EXTENSION=false
|
||||||
- COMPOSER_GLOBAL_INSTALL=false
|
- COMPOSER_GLOBAL_INSTALL=false
|
||||||
|
@ -11,6 +11,7 @@ services:
|
|||||||
- INSTALL_XDEBUG=false
|
- INSTALL_XDEBUG=false
|
||||||
- INSTALL_MONGO=false
|
- INSTALL_MONGO=false
|
||||||
- INSTALL_NODE=false
|
- INSTALL_NODE=false
|
||||||
|
- INSTALL_YARN=false
|
||||||
- INSTALL_DRUSH=false
|
- INSTALL_DRUSH=false
|
||||||
- INSTALL_AEROSPIKE_EXTENSION=false
|
- INSTALL_AEROSPIKE_EXTENSION=false
|
||||||
- COMPOSER_GLOBAL_INSTALL=false
|
- COMPOSER_GLOBAL_INSTALL=false
|
||||||
|
@ -181,6 +181,30 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
|
|||||||
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
|
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
|
||||||
;fi
|
;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:
|
# PHP Aerospike:
|
||||||
#####################################
|
#####################################
|
||||||
|
Loading…
Reference in New Issue
Block a user