add quotes around SMTP_PASSWORD
[discourse_docker.git] / image / base / Dockerfile
CommitLineData
be82e068 1# NAME: discourse_base
71c3c655 2# VERSION: 1.3.3
be82e068 3
00dab51a 4FROM ubuntu:16.04
e1903539 5
8e8c1172 6ENV PG_MAJOR 9.5
00dab51a 7ENV PG_VERSION 9.5.3-1.pgdg16.04+1
8e8c1172 8
e1903539
SS
9MAINTAINER Sam Saffron "https://twitter.com/samsaffron"
10
955d360c 11RUN echo "1.3.3" > /VERSION
0b72000a 12
00dab51a
GXT
13RUN apt-get update && apt-get install -y lsb-release sudo curl
14RUN echo "debconf debconf/frontend select Teletype" | debconf-set-selections
15RUN echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main restricted universe" > /etc/apt/sources.list
16RUN echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-updates main restricted universe" >> /etc/apt/sources.list
17RUN echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-security main restricted universe" >> /etc/apt/sources.list
18RUN apt-get update && apt-get -y install fping
19RUN sh -c "fping proxy && echo 'Acquire { Retries \"0\"; HTTP { Proxy \"http://proxy:3128\";}; };' > /etc/apt/apt.conf.d/40proxy && apt-get update || true"
20RUN apt-get -y install software-properties-common
21RUN apt-mark hold initscripts
22RUN apt-get -y upgrade
23RUN add-apt-repository -y ppa:nginx/development
24RUN curl http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add -
25RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main" | \
26 tee /etc/apt/sources.list.d/postgres.list
27RUN curl --silent --location https://deb.nodesource.com/setup_4.x | sudo bash -
28RUN apt-get -y update
29RUN apt-get -y install build-essential git wget \
d08dd53f
RH
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 \
00dab51a
GXT
35 nginx language-pack-en cron anacron \
36 psmisc rsyslog vim whois
37RUN sed -i -e 's/start -q anacron/anacron -s/' /etc/cron.d/anacron
38RUN sed -i.bak 's/$ModLoad imklog/#$ModLoad imklog/' /etc/rsyslog.conf
39RUN dpkg-divert --local --rename --add /sbin/initctl
40RUN sh -c "test -f /sbin/initctl || ln -s /bin/true /sbin/initctl"
41RUN apt-get -y install redis-server haproxy openssh-server
42RUN 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 49 npm install uglify-js -g &&\
00dab51a 50 npm install svgo -g
536ca9dd
S
51RUN apt-get -y install advancecomp jhead jpegoptim libjpeg-turbo-progs optipng
52
fdc85645 53
b16d1acf 54# consider upgrading this
fdc85645
S
55RUN mkdir /jemalloc && cd /jemalloc &&\
56 wget http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2 &&\
57 tar -xjf jemalloc-3.6.0.tar.bz2 && cd jemalloc-3.6.0 && ./configure && make &&\
58 mv lib/libjemalloc.so.1 /usr/lib && cd / && rm -rf /jemalloc
59
71c3c655
S
60RUN 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.3.1 /usr/local
64
65RUN gem install bundler &&\
66 rm -rf /usr/local/share/ri/2.3.0/system &&\
67 cd / && git clone https://github.com/SamSaffron/pups.git
68
8c9edf52
S
69ADD install-imagemagick /tmp/install-imagemagick
70RUN /tmp/install-imagemagick
71
71c3c655 72# Validate install
82a947fe 73RUN ruby -e "v='`convert -version`'; ['png','tiff','jpeg','freetype'].each{ |f| ((STDERR.puts('no ' + f + ' support in imagemagick')); exit(-1)) unless v.include?(f)}"
71c3c655
S
74
75#
fdc85645
S
76ADD install-pngcrush /tmp/install-pngcrush
77RUN /tmp/install-pngcrush
78
79ADD install-gifsicle /tmp/install-gifsicle
80RUN /tmp/install-gifsicle
81
82ADD install-pngquant /tmp/install-pngquant
83RUN /tmp/install-pngquant
5d6f9ed2 84
dc7a8ede 85RUN cd tmp && wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
dc7a8ede
S
86RUN cd tmp && tar jxf phantomjs-2.1.1-linux-x86_64.tar.bz2 && mv /tmp/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin
87
05a13f9e 88# clean up for docker squash
536ca9dd
S
89RUN rm -fr /usr/share/man &&\
90 rm -fr /usr/share/doc &&\
91 rm -fr /usr/share/vim/vim74/tutor &&\
92 rm -fr /usr/share/vim/vim74/doc &&\
93 rm -fr /usr/share/vim/vim74/lang &&\
94 rm -fr /usr/local/share/doc &&\
95 rm -fr /usr/local/share/ruby-build &&\
96 rm -fr /root/.gem &&\
dc7a8ede
S
97 rm -fr /root/.npm &&\
98 rm -fr /tmp/* &&\
99 rm -fr /usr/share/vim/vim74/spell/en*
100
536ca9dd
S
101
102# this can probably be done, but I worry that people changing PG locales will have issues
103# cd /usr/share/locale && rm -fr `ls -d */ | grep -v en`
104
105
106RUN mkdir -p /etc/runit/3.d
23022c1d
MB
107
108ADD runit-1 /etc/runit/1
109ADD runit-1.d-cleanup-pids /etc/runit/1.d/cleanup-pids
b8dfc9a7 110ADD runit-1.d-anacron /etc/runit/1.d/anacron
23022c1d 111ADD runit-2 /etc/runit/2
074f2b6a
S
112ADD runit-3 /etc/runit/3
113ADD boot /sbin/boot
be82e068
S
114
115ADD cron /etc/service/cron/run
116ADD rsyslog /etc/service/rsyslog/run