FROM phusion/baseimage

MAINTAINER Sharry Stowell

CMD ["/sbin/my_init"]

RUN apt-get update && apt-get install -y \
    git \
    wget \
    libxml2-dev \
    python \
    build-essential \
    make \
    gcc \
    htop \
    byobu

# Install Node
RUN \
  wget -O - http://nodejs.org/dist/v0.10.29/node-v0.10.29-linux-x64.tar.gz \
  | tar xzf - --strip-components=1 --exclude="README.md" --exclude="LICENSE" \
  --exclude="ChangeLog" -C "/usr/local"

# Global NPM installs
RUN npm install --silent -g gulp mocha bower nodemon

# Get the repository from Github
RUN git clone https://83cbb505d46274d68f5cee34b032c89edfbc5d13:x-oauth-basic@github.com/sosocial/sosocial-website.git /home/sosocial-website

# Set the working directory
WORKDIR /home/sosocial-website

# Copy docker config file to be used in mesos launcher
ADD .dockercfg /etc/

RUN npm install

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#ENV NODE_ENV development

VOLUME ["/home/sosocial-website"]

EXPOSE 3001

CMD []
ENTRYPOINT ["nodemon", "server.js"]