Last active
September 27, 2016 04:44
-
-
Save indykish/1afd4e5802d319fc63b2d32bc16a738f to your computer and use it in GitHub Desktop.
Nilavu production tuneup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Base image prepare | |
apt-get -y update | |
apt-get -y install build-essential git wget \ | |
libxslt-dev libcurl4-openssl-dev \ | |
libssl-dev libyaml-dev libtool \ | |
libxml2-dev gawk parallel \ | |
libreadline-dev \ | |
language-pack-en cron anacron \ | |
psmisc rsyslog whois brotli | |
### Add user nilavu and clone 1.5 branch with tag xyz | |
useradd discourse -s /bin/bash -m -U &&\ mkdir -p /var/www && cd /var/www &&\ | |
git clone https://github.com/discourse/discourse.git &&\ | |
cd discourse &&\ | |
git remote set-branches --add origin tests-passed | |
### Prepare runit. | |
cd / &&\ | |
apt-get -y install runit monit socat &&\ | |
mkdir -p /etc/runit/1.d &&\ | |
apt-get clean &&\ | |
rm -f /etc/apt/apt.conf.d/40proxy &&\ | |
locale-gen en_US &&\ | |
apt-get install -y nodejs &&\ | |
npm install uglify-js -g &&\ | |
npm install svgo -g | |
### Install nginx | |
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/install-nginx | |
mv install-nginx /tmp/install-nginx | |
/tmp/install-nginx | |
### Install jmealloc | |
mkdir /jemalloc && cd /jemalloc &&\ | |
wget http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2 &&\ | |
tar -xjf jemalloc-3.6.0.tar.bz2 && cd jemalloc-3.6.0 && ./configure && make &&\ | |
mv lib/libjemalloc.so.1 /usr/lib && cd / && rm -rf /jemalloc | |
### Install Ruby | |
echo 'gem: --no-document' >> /usr/local/etc/gemrc &&\ | |
mkdir /src && cd /src && git clone https://github.com/sstephenson/ruby-build.git &&\ | |
cd /src/ruby-build && ./install.sh &&\ | |
cd / && rm -rf /src/ruby-build && ruby-build 2.3.1 /usr/local | |
### Install bundler | |
gem install bundler &&\ | |
rm -rf /usr/local/share/ri/2.3.0/system | |
### Cleanup file | |
rm -fr /usr/share/man &&\ | |
rm -fr /usr/share/doc &&\ | |
rm -fr /usr/local/share/doc &&\ | |
rm -fr /usr/local/share/ruby-build &&\ | |
rm -fr /root/.gem &&\ | |
rm -fr /root/.npm &&\ | |
rm -fr /tmp/* && | |
### runit prepare | |
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/runit-1 | |
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/runit-1.d-00-fix-var-logs | |
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/runit-1.d-cleanup-pids | |
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/runit-2 | |
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/runit-3 | |
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/boot | |
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/cron | |
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/rsyslog | |
mkdir -p /etc/runit/3.d | |
mv runit-1 /etc/runit/1 | |
mv runit-1.d-cleanup-pids /etc/runit/1.d/cleanup-pids | |
mv runit-1.d-00-fix-var-logs /etc/runit/1.d/00-fix-var-logs | |
mv runit-2 /etc/runit/2 | |
mv runit-3 /etc/runit/3 | |
mv boot /sbin/boot | |
mv cron /etc/service/cron/run | |
mv rsyslog /etc/service/rsyslog/run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment