Skip to content

Instantly share code, notes, and snippets.

@29decibel
Forked from eikes/run phoenix on amazon linux.sh
Last active September 27, 2016 03:30
Show Gist options
  • Save 29decibel/fe0f31a26ba12c7c42875061a303d606 to your computer and use it in GitHub Desktop.
Save 29decibel/fe0f31a26ba12c7c42875061a303d606 to your computer and use it in GitHub Desktop.
run phoenix on amazon linux
# app deps
sudo yum install git
# erlang deps
sudo yum groupinstall "Development Tools"
sudo yum install ncurses-devel
# erlang
wget http://www.erlang.org/download/otp_src_19.1.tar.gz
tar -zxvf otp_src_19.1.tar.gz
rm otp_src_19.1.tar.gz
cd otp_src_19.1/
./configure
make
sudo make install
# elixir
wget https://github.com/elixir-lang/elixir/archive/v1.3.2.zip
unzip v1.3.2.zip
cd elixir-1.3.2/
make
echo "PATH=\$PATH:/root/setup-elixir/elixir-1.3.2/bin" >> .bashrc
# phoenix deps
sudo yum install postgresql
mix local.hex
# nodejs
curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash -
yum -y install nodejs
# listen on port 80 as well
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 4001
git clone git://github.com/user_name/my-phonix-app
cd my-phoenix-app
npm install
mix deps.get
MIX_ENV=prod mix ecto.create
MIX_ENV=prod mix ecto.migrate
brunch build --production
MIX_ENV=prod mix phoenix.digest
MIX_ENV=prod PORT=4001 elixir --detached -S mix do compile, phoenix.server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment