Merge pull request #261 from appleboy/patch-4
support specific node version
This commit is contained in:
commit
6c71d6d84f
|
@ -16,6 +16,7 @@ services:
|
||||||
- INSTALL_WORKSPACE_SSH=false
|
- INSTALL_WORKSPACE_SSH=false
|
||||||
- PUID=1000
|
- PUID=1000
|
||||||
- PGID=1000
|
- PGID=1000
|
||||||
|
- NODE_VERSION=stable
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- volumes_source
|
- volumes_source
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
|
|
|
@ -141,16 +141,18 @@ USER laradock
|
||||||
#####################################
|
#####################################
|
||||||
|
|
||||||
# Check if NVM needs to be installed
|
# Check if NVM needs to be installed
|
||||||
|
ARG NODE_VERSION=stable
|
||||||
|
ENV NODE_VERSION ${NODE_VERSION}
|
||||||
ARG INSTALL_NODE=true
|
ARG INSTALL_NODE=true
|
||||||
ENV INSTALL_NODE ${INSTALL_NODE}
|
ENV INSTALL_NODE ${INSTALL_NODE}
|
||||||
ENV NVM_DIR /home/laradock/.nvm
|
ENV NVM_DIR /home/laradock/.nvm
|
||||||
RUN if [ ${INSTALL_NODE} = true ]; then \
|
RUN if [ ${INSTALL_NODE} = true ]; then \
|
||||||
# Install nvm (A Node Version Manager)
|
# Install nvm (A Node Version Manager)
|
||||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash && \
|
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.6/install.sh | bash && \
|
||||||
. ~/.nvm/nvm.sh && \
|
. ~/.nvm/nvm.sh && \
|
||||||
nvm install stable && \
|
nvm install ${NODE_VERSION} && \
|
||||||
nvm use stable && \
|
nvm use ${NODE_VERSION} && \
|
||||||
nvm alias stable && \
|
nvm alias ${NODE_VERSION} && \
|
||||||
npm install -g gulp bower \
|
npm install -g gulp bower \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue