Commit | Line | Data |
---|---|---|
be82e068 | 1 | # NAME: discourse_base |
8e8c1172 | 2 | # VERSION: 1.0.18 |
be82e068 | 3 | |
025a598b | 4 | FROM ubuntu:14.04 |
e1903539 | 5 | |
8e8c1172 GXT |
6 | ENV PG_MAJOR 9.5 |
7 | ENV PG_VERSION 9.5.3-1.pgdg14.04+1 | |
8 | ||
e1903539 SS |
9 | MAINTAINER Sam Saffron "https://twitter.com/samsaffron" |
10 | ||
0b72000a S |
11 | RUN echo "1.0.13" > /VERSION |
12 | ||
0b0d6fcb | 13 | RUN echo "debconf debconf/frontend select Teletype" | debconf-set-selections &&\ |
e56a65f6 MB |
14 | echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main restricted universe" > /etc/apt/sources.list &&\ |
15 | echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-updates main restricted universe" >> /etc/apt/sources.list &&\ | |
16 | echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-security main restricted universe" >> /etc/apt/sources.list &&\ | |
17 | apt-get update && apt-get -y install fping &&\ | |
18 | sh -c "fping proxy && echo 'Acquire { Retries \"0\"; HTTP { Proxy \"http://proxy:3128\";}; };' > /etc/apt/apt.conf.d/40proxy && apt-get update || true" &&\ | |
025a598b | 19 | apt-get -y install software-properties-common &&\ |
2bdce9f4 MB |
20 | apt-mark hold initscripts &&\ |
21 | apt-get -y upgrade &&\ | |
e1903539 | 22 | add-apt-repository -y ppa:rwky/redis &&\ |
6f85e815 | 23 | add-apt-repository -y ppa:nginx/development &&\ |
b404fee4 | 24 | apt-get install -y curl && curl http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add - &&\ |
025a598b | 25 | echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | \ |
e56a65f6 | 26 | tee /etc/apt/sources.list.d/postgres.list &&\ |
2dab6aa1 | 27 | curl --silent --location https://deb.nodesource.com/setup_4.x | sudo bash - &&\ |
e1903539 | 28 | apt-get -y update &&\ |
d08dd53f RH |
29 | apt-get -y install build-essential git curl wget \ |
30 | libxslt-dev libcurl4-openssl-dev \ | |
31 | libssl-dev libyaml-dev libtool \ | |
d821539c | 32 | libxml2-dev gawk parallel \ |
8e8c1172 GXT |
33 | postgresql-${PG_MAJOR}=${PG_VERSION} postgresql-client-${PG_MAJOR}=${PG_VERSION} \ |
34 | postgresql-contrib-${PG_MAJOR}=${PG_VERSION} libpq-dev libreadline-dev \ | |
df684d76 | 35 | nginx language-pack-en sudo cron anacron \ |
ce2f683e | 36 | psmisc rsyslog vim whois &&\ |
bdf366b3 | 37 | sed -i -e 's/start -q anacron/anacron -s/' /etc/cron.d/anacron &&\ |
e56a65f6 | 38 | sed -i.bak 's/$ModLoad imklog/#$ModLoad imklog/' /etc/rsyslog.conf &&\ |
e1903539 | 39 | dpkg-divert --local --rename --add /sbin/initctl &&\ |
2bdce9f4 | 40 | sh -c "test -f /sbin/initctl || ln -s /bin/true /sbin/initctl" &&\ |
d08dd53f | 41 | apt-get -y install redis-server haproxy openssh-server &&\ |
be82e068 | 42 | cd / &&\ |
2cc4e49f | 43 | apt-get -y install runit monit socat &&\ |
23022c1d | 44 | mkdir -p /etc/runit/1.d &&\ |
d08dd53f | 45 | apt-get clean &&\ |
2bdce9f4 | 46 | rm -f /etc/apt/apt.conf.d/40proxy &&\ |
be82e068 | 47 | locale-gen en_US &&\ |
edcdd0c9 | 48 | apt-get install -y nodejs &&\ |
fdc85645 S |
49 | npm install uglify-js -g &&\ |
50 | npm install svgo -g &&\ | |
51 | apt-get -y install advancecomp jhead jpegoptim libjpeg-progs optipng | |
52 | ||
53 | # TODO check when binary packages are ready (not yet) | |
54 | RUN wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 &&\ | |
55 | tar -xjf phantomjs-1.9.8-linux-x86_64.tar.bz2 &&\ | |
56 | rm phantomjs-1.9.8-linux-x86_64.tar.bz2 &&\ | |
57 | cp phantomjs-1.9.8-linux-x86_64/bin/phantomjs /bin/phantomjs &&\ | |
58 | rm -fr phantomjs-1.9.8-linux-x86_64 | |
59 | ||
60 | RUN mkdir /jemalloc && cd /jemalloc &&\ | |
61 | wget http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2 &&\ | |
62 | tar -xjf jemalloc-3.6.0.tar.bz2 && cd jemalloc-3.6.0 && ./configure && make &&\ | |
63 | mv lib/libjemalloc.so.1 /usr/lib && cd / && rm -rf /jemalloc | |
64 | ||
8c9edf52 S |
65 | ADD install-imagemagick /tmp/install-imagemagick |
66 | RUN /tmp/install-imagemagick | |
67 | ||
fdc85645 S |
68 | ADD install-pngcrush /tmp/install-pngcrush |
69 | RUN /tmp/install-pngcrush | |
70 | ||
71 | ADD install-gifsicle /tmp/install-gifsicle | |
72 | RUN /tmp/install-gifsicle | |
73 | ||
74 | ADD install-pngquant /tmp/install-pngquant | |
75 | RUN /tmp/install-pngquant | |
5d6f9ed2 | 76 | |
edcdd0c9 S |
77 | RUN add-apt-repository ppa:ubuntu-toolchain-r/test &&\ |
78 | apt-get update &&\ | |
79 | apt-get install -y gcc-4.9 &&\ | |
80 | (cd /usr/bin && rm gcc && ln -s gcc-4.9 gcc) &&\ | |
81 | echo 'gem: --no-document' >> /usr/local/etc/gemrc &&\ | |
be82e068 S |
82 | mkdir /src && cd /src && git clone https://github.com/sstephenson/ruby-build.git &&\ |
83 | cd /src/ruby-build && ./install.sh &&\ | |
1ed6730f | 84 | cd / && rm -rf /src/ruby-build && ruby-build 2.0.0-p647 /usr/local &&\ |
be82e068 | 85 | gem update --system &&\ |
05a13f9e S |
86 | gem install bundler &&\ |
87 | rm -rf /usr/local/share/ri/2.0.0/system &&\ | |
88 | cd / && git clone https://github.com/SamSaffron/pups.git | |
be82e068 | 89 | |
05a13f9e | 90 | # clean up for docker squash |
074f2b6a | 91 | RUN rm -fr /usr/share/man && rm -fr /usr/share/doc && mkdir -p /etc/runit/3.d |
23022c1d MB |
92 | |
93 | ADD runit-1 /etc/runit/1 | |
94 | ADD runit-1.d-cleanup-pids /etc/runit/1.d/cleanup-pids | |
b8dfc9a7 | 95 | ADD runit-1.d-anacron /etc/runit/1.d/anacron |
23022c1d | 96 | ADD runit-2 /etc/runit/2 |
074f2b6a S |
97 | ADD runit-3 /etc/runit/3 |
98 | ADD boot /sbin/boot | |
be82e068 S |
99 | |
100 | ADD cron /etc/service/cron/run | |
101 | ADD rsyslog /etc/service/rsyslog/run |