Created
January 11, 2016 07:37
-
-
Save woss/0abe638e371622f13fd0 to your computer and use it in GitHub Desktop.
Docker and nvm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04.3 | |
# Replace shell with bash so we can source files | |
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | |
# make sure apt is up to date | |
RUN apt-get update --fix-missing | |
RUN apt-get install -y curl | |
RUN sudo apt-get install -y build-essential libssl-dev | |
ENV NVM_DIR /usr/local/nvm | |
ENV NODE_VERSION 4.2.4 | |
# Install nvm with node and npm | |
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | bash \ | |
&& source $NVM_DIR/nvm.sh \ | |
&& nvm install $NODE_VERSION \ | |
&& nvm alias default $NODE_VERSION \ | |
&& nvm use default | |
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules | |
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH | |
RUN mkdir /usr/app | |
RUN mkdir /usr/app/log | |
WORKDIR /usr/app | |
# log dir | |
VOLUME /usr/app/log | |
# Bundle app source | |
COPY . /usr/app | |
# Install app dependencies | |
RUN npm install | |
EXPOSE 3000 | |
CMD ["node", "server.js"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment