| 1 | # Official repo only has a ppa for postgresql 9.3 at the moment (14/3/2014) |
| 2 | # When new LTS ships we can upgrade |
| 3 | |
| 4 | # NAME: discourse_base |
| 5 | # VERSION: 1.0.0 |
| 6 | |
| 7 | FROM ubuntu:14.04 |
| 8 | |
| 9 | MAINTAINER Sam Saffron "https://twitter.com/samsaffron" |
| 10 | |
| 11 | RUN echo "debconf debconf/frontend select Teletype" | debconf-set-selections &&\ |
| 12 | apt-get -y install fping &&\ |
| 13 | sh -c "fping proxy && echo 'Acquire { Retries \"0\"; HTTP { Proxy \"http://proxy:3128\";}; };' > /etc/apt/apt.conf.d/40proxy || true" &&\ |
| 14 | apt-get -y update &&\ |
| 15 | apt-get -y install software-properties-common &&\ |
| 16 | add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe" &&\ |
| 17 | add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-updates main universe" &&\ |
| 18 | apt-get -y update &&\ |
| 19 | apt-mark hold initscripts &&\ |
| 20 | apt-get -y upgrade &&\ |
| 21 | add-apt-repository -y ppa:rwky/redis &&\ |
| 22 | add-apt-repository -y ppa:nginx/stable &&\ |
| 23 | apt-get install -y curl && curl http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add - &&\ |
| 24 | echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | \ |
| 25 | tee /etc/apt/sources.list.d/postgres.list &&\ |
| 26 | apt-get -y update &&\ |
| 27 | apt-get -y install build-essential git curl wget \ |
| 28 | libxslt-dev libcurl4-openssl-dev \ |
| 29 | libssl-dev libyaml-dev libtool \ |
| 30 | libxml2-dev gawk \ |
| 31 | pngcrush imagemagick \ |
| 32 | postgresql-9.3 postgresql-client-9.3 \ |
| 33 | postgresql-contrib-9.3 libpq-dev libreadline-dev \ |
| 34 | nginx language-pack-en sudo cron \ |
| 35 | psmisc rsyslog vim &&\ |
| 36 | dpkg-divert --local --rename --add /sbin/initctl &&\ |
| 37 | sh -c "test -f /sbin/initctl || ln -s /bin/true /sbin/initctl" &&\ |
| 38 | apt-get -y install redis-server haproxy openssh-server &&\ |
| 39 | cd / &&\ |
| 40 | mkdir /jemalloc && cd /jemalloc &&\ |
| 41 | wget http://www.canonware.com/download/jemalloc/jemalloc-3.4.1.tar.bz2 &&\ |
| 42 | tar -xvjf jemalloc-3.4.1.tar.bz2 && cd jemalloc-3.4.1 && ./configure && make &&\ |
| 43 | mv lib/libjemalloc.so.1 /usr/lib && cd / && rm -rf /jemalloc &&\ |
| 44 | apt-get -y install runit monit socat &&\ |
| 45 | mkdir -p /etc/runit/1.d &&\ |
| 46 | apt-get clean &&\ |
| 47 | rm -f /etc/apt/apt.conf.d/40proxy &&\ |
| 48 | locale-gen en_US &&\ |
| 49 | wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\ |
| 50 | tar -xjf phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\ |
| 51 | rm phantomjs-1.9.7-linux-x86_64.tar.bz2 &&\ |
| 52 | cp phantomjs-1.9.7-linux-x86_64/bin/phantomjs /bin/phantomjs &&\ |
| 53 | rm -fr phantomjs-1.9.7-linux-x86_64 &&\ |
| 54 | wget http://static.jonof.id.au/dl/kenutils/pngout-20130221-linux.tar.gz &&\ |
| 55 | tar -xvf pngout-20130221-linux.tar.gz &&\ |
| 56 | rm pngout-20130221-linux.tar.gz &&\ |
| 57 | cp pngout-20130221-linux/x86_64/pngout /bin/pngout &&\ |
| 58 | rm -rf pngout-20130221-linux |
| 59 | |
| 60 | RUN echo 'gem: --no-document' >> /usr/local/etc/gemrc &&\ |
| 61 | mkdir /src && cd /src && git clone https://github.com/sstephenson/ruby-build.git &&\ |
| 62 | cd /src/ruby-build && ./install.sh &&\ |
| 63 | cd / && rm -rf /src/ruby-build && ruby-build 2.0.0-p481 /usr/local &&\ |
| 64 | gem update --system &&\ |
| 65 | gem install bundler |
| 66 | |
| 67 | RUN cd / && git clone https://github.com/SamSaffron/pups.git |
| 68 | |
| 69 | ADD runit-1 /etc/runit/1 |
| 70 | ADD runit-1.d-cleanup-pids /etc/runit/1.d/cleanup-pids |
| 71 | ADD runit-2 /etc/runit/2 |
| 72 | |
| 73 | ADD cron /etc/service/cron/run |
| 74 | ADD rsyslog /etc/service/rsyslog/run |
| 75 | |
| 76 | RUN sed -i.bak 's/$ModLoad imklog/#$ModLoad imklog/' /etc/rsyslog.conf |