now npm and node are properly set

This commit is contained in:
Philipp Kunz 2016-02-28 00:15:12 +01:00
parent b3bfb0d042
commit 0bf796ff58

View File

@ -1,20 +1,36 @@
FROM debian
# Install prerequirements or NVM
RUN apt-get update \
&& apt-get install -y \
curl \
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Set debconf to run non-interactively
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Install base dependencies
RUN apt-get update && apt-get install -y -q --no-install-recommends \
apt-transport-https \
build-essential \
python
ca-certificates \
curl \
git \
libssl-dev \
python \
rsync \
software-properties-common \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install NVM with node
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | NVM_DIR="/nvm" bash \
&& bash -c "source /nvm/nvm.sh \
&& nvm install 4.3.1 \
&& nvm alias default v4.3.1"
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 4.3.1
ADD .bashrc /.bashrc
# Install nvm with node and npm
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash \
&& source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
ENV BASH_ENV /.bashrc
RUN ln -snf /bin/bash /bin/sh
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
RUN node -v
RUN npm -v