-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsetup_chat.sh
executable file
·47 lines (41 loc) · 1.24 KB
/
setup_chat.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#/bin/sh
set -e
cat <<EOF >> /etc/sysctl.conf
fs.file-max=22000500
fs.nr_open=30000500
net.ipv4.tcp_mem='10000000 10000000 10000000'
net.ipv4.tcp_rmem='1024 4096 16384'
net.ipv4.tcp_wmem='1024 4096 16384'
net.core.rmem_max=16384
net.core.wmem_max=16384
net.ipv4.tcp_moderate_rcvbuf=0
net.core.somaxconn=4096
net.core.netdev_max_backlog=4096
net.ipv4.tcp_max_syn_backlog=4096
EOF
cat <<EOF >> /etc/security/limits.conf
root hard nofile 30000000
root soft nofile 30000000
EOF
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y --no-install-recommends elixir git esl-erlang nodejs htop patch
sudo update-locale LC_ALL=en_US.UTF-8
rm -rf chat
git clone https://github.com/chrismccord/phoenix_chat_example.git chat
cd chat
git checkout 02bbbc8a295542146aef4e347dcbdc5fd0aadd69
wget https://dl.dropboxusercontent.com/u/62784372/benchmark.patch
cat benchmark.patch | patch -p1
export MIX_ENV=prod
export PORT=4000
mix local.hex --force
mix local.rebar --force
mix deps.get
mix deps.compile
npm install -g brunch
npm install
brunch build
echo manual | sudo tee /etc/init/docker.override
reboot