Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################################
- # Base image
- #
- # Installs all necessary packaging, including system
- # packages, user specific python/node/ruby versions, and
- # related packages for each (npm, pip, gem) etc.
- #
- # This reduces build time as package configuration
- # doesn't change often, and speeds up local development
- # by not requiring package installs/compiles on each restart
- #
- # This base is tailored to our specific needs, but can
- # easily be modified for any other project
- #
- ################################################
- # Use modified ubuntu image, it contains some nice fixes
- # over the stock image
- #FROM ubuntu:14.04
- FROM dockerfile/ubuntu
- # Let the conatiner know that there is no tty
- ENV DEBIAN_FRONTEND noninteractive
- USER root
- # install system packages
- RUN apt-get update
- RUN apt-get install -y nano curl git man wget ruby nodejs python-mysqldb \
- python-pip python-dev python-setuptools python-virtualenv virtualenvwrapper \
- libzmq-dev imagemagick phantomjs software-properties-common
- # create application user
- RUN useradd -m -s /bin/bash app
- # install mariadb repo and client
- RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
- RUN add-apt-repository 'deb http://mirrors.coreix.net/mariadb/repo/10.0/ubuntu trusty main'
- RUN apt-get update
- RUN apt-get install -y libssl-dev mariadb-client-10.0 mysql-common libmariadbclient-dev
- # install NVM
- USER root
- RUN sudo su - app -c "curl https://raw.githubusercontent.com/creationix/nvm/v0.17.3/install.sh | HOME=/home/app bash"
- RUN sudo su - app -c "echo 'source ~/.nvm/nvm.sh' >> /home/app/.profile"
- RUN sudo su - app -c "nvm install 0.10.32"
- RUN sudo su - app -c "echo 'nvm use 0.10.32' >> /home/app/.profile"
- RUN sudo su - app -c "nvm use 0.10.32"
- # install RVM
- RUN apt-get install -y gawk libreadline6-dev libyaml-dev libsqlite3-dev sqlite3 autoconf \
- libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev
- RUN sudo su - app -c "gpg --keyserver keyserver.ubuntu.com --recv-keys D39DC0E3"
- RUN sudo su - app -c "curl -sSL https://get.rvm.io | bash -s -- stable --autolibs=read-fail"
- RUN sudo su - app -c "echo 'source ~/.rvm/scripts/rvm' >> /home/app/.profile"
- RUN sudo su - app -c "rvm install 2.1.3"
- RUN sudo su - app -c "echo 'rvm use 2.1.3' >> /home/app/.profile"
- RUN sudo su - app -c "rvm use 2.1.3"
- RUN sudo su - app -c "gem install sass"
- # install python
- RUN sudo su - app -c "echo 'source /usr/share/virtualenvwrapper/virtualenvwrapper.sh' >> /home/app/.profile"
- RUN sudo su - app -c "mkvirtualenv app"
- RUN sudo su - app -c "echo 'workon app' >> /home/app/.profile"
- # install logentries
- RUN add-apt-repository 'deb http://rep.logentries.com/ trusty main'
- RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 C43C79AD
- RUN apt-get update
- RUN apt-get install -y logentries logentries-daemon
- # prep app env
- RUN sudo su - app -c "mkdir ~/frontend"
- RUN sudo su - app -c "mkdir ~/frontend/logs"
- RUN sudo su - app -c "mkdir ~/frontend/run"
- RUN sudo su - app -c "mkdir ~/frontend/conf"
- # install node user packages, this requires some trickery due
- # to the way that npm works
- ADD frontend/frontend/static/package.json /home/app/frontend/
- RUN sudo su - app -c "cd ~/frontend; npm install"
- RUN sudo su - app -c "mv ~/frontend/node_modules/ ~/.node_modules"
- RUN rm -f /home/app/frontend/package.json
- RUN sudo su - app -c "echo 'PATH=\$PATH:\$HOME/.node_modules/.bin' >> /home/app/.profile"
- RUN cat /home/app/.profile
- # install python packages
- ADD frontend/requirements.txt /home/app/frontend/
- RUN sudo su - app -c "pip install -r ~/frontend/requirements.txt"
- RUN rm -f /home/app/frontend/requirements.txt
Advertisement
Add Comment
Please, Sign In to add comment