2015-01-26 23:49:42 +01:00
|
|
|
# start with docker's base ubuntu image
|
|
|
|
FROM ubuntu:14.04
|
|
|
|
MAINTAINER Adam Brown "adamarthurryan@gmail.com"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# update package sources
|
2015-01-27 02:07:01 +01:00
|
|
|
# and get some basics
|
|
|
|
RUN apt-get -y update && apt-get -y install \
|
|
|
|
build-essential \
|
|
|
|
libssl-dev \
|
|
|
|
curl \
|
|
|
|
git
|
2015-01-26 23:49:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
# install mongo db
|
|
|
|
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
|
|
|
|
RUN echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/mongodb.list
|
2015-01-27 02:07:01 +01:00
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
mongodb-org
|
2015-01-26 23:49:42 +01:00
|
|
|
|
|
|
|
# install node.js
|
|
|
|
RUN curl -sL https://deb.nodesource.com/setup | bash -
|
|
|
|
RUN apt-get install -y nodejs
|
|
|
|
|
|
|
|
# install ruby and the SASS rubygem
|
|
|
|
RUN apt-get install -y ruby
|
|
|
|
RUN gem install sass
|
|
|
|
|
2015-01-27 02:07:01 +01:00
|
|
|
# add a user
|
|
|
|
RUN useradd -ms /bin/bash docker
|
2015-01-26 23:49:42 +01:00
|
|
|
|
|
|
|
# switch to the docker user
|
|
|
|
ENV HOME /home/docker
|
|
|
|
USER docker
|
|
|
|
|
2015-01-27 02:07:01 +01:00
|
|
|
# configure npm to run without sudo permissions
|
|
|
|
RUN mkdir $HOME/.npm-packages
|
|
|
|
RUN echo 'prefix=${HOME}/.npm-packages' >> $HOME/.npmrc
|
2015-01-26 23:49:42 +01:00
|
|
|
|
2015-01-27 02:07:01 +01:00
|
|
|
ENV NPM_PACKAGES $HOME/.npm-packages
|
|
|
|
ENV NODE_PATH $NPM_PACKAGES/lib/node_modules:$NODE_PATH
|
|
|
|
ENV PATH $NPM_PACKAGES/bin:$PATH
|
|
|
|
ENV MANPATH $NPM_PACKAGES/share/man:$(manpath)
|
2015-01-26 23:49:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
# install yeoman tooling and other npm packages
|
|
|
|
RUN npm install -g node-gyp
|
|
|
|
RUN npm install -g yo bower grunt-cli
|
|
|
|
RUN npm install -g generator-webapp generator-angular generator-angular-fullstack
|
|
|
|
|
2015-01-27 02:07:01 +01:00
|
|
|
# setup the mongo path
|
|
|
|
ENV MONGO_DB $HOME/.mongodb
|
|
|
|
ENV MONGO_LOG $HOME/.mongodb.log
|
|
|
|
RUN mkdir $MONGO_DB
|
|
|
|
|
|
|
|
# launch mongo
|
2015-01-27 03:52:07 +01:00
|
|
|
# this just preps the database - it still needs to be launched inside the docker container
|
|
|
|
RUN mongod --dbpath $MONGO_DB --logpath $MONGO_LOG --fork --journal
|
2015-01-27 02:07:01 +01:00
|
|
|
|
2015-01-27 03:52:07 +01:00
|
|
|
# create a script for launching mongo from the docker container
|
|
|
|
# this could go in .bashrc or something
|
|
|
|
# perhaps mongo should use the /data volume for its database?
|
2015-01-27 03:06:38 +01:00
|
|
|
RUN mkdir $HOME/bin
|
|
|
|
RUN echo 'mongod --dbpath $MONGO_DB --logpath $MONGO_LOG --fork --journal' > $HOME/bin/mongod-start
|
|
|
|
RUN chmod +x $HOME/bin/mongod-start
|
|
|
|
ENV PATH $PATH:$HOME/bin
|
2015-01-27 02:07:01 +01:00
|
|
|
|
2015-01-27 03:06:38 +01:00
|
|
|
# create a data volume
|
|
|
|
VOLUME /data
|
2015-01-27 02:07:01 +01:00
|
|
|
|
|
|
|
# expose the ports
|
|
|
|
EXPOSE 8000
|
|
|
|
EXPOSE 9000
|
|
|
|
EXPOSE 3000
|
|
|
|
EXPOSE 35729
|
2015-01-27 03:06:38 +01:00
|
|
|
|
|
|
|
|
2015-02-01 22:02:11 +01:00
|
|
|
# configure git
|
|
|
|
git config --global push.default simple
|
|
|
|
|
|
|
|
# !!! how to securely configure the username / password?
|