Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save troygnichols/c17eeac9649b5471433f8239058473dd to your computer and use it in GitHub Desktop.
Save troygnichols/c17eeac9649b5471433f8239058473dd to your computer and use it in GitHub Desktop.
run phoenix on amazon linux
cd ~
# app deps
sudo yum -y install git
# erlang deps
sudo yum -y groupinstall "Development Tools"
sudo yum -y install ncurses-devel
sudo yum install -y fop
sudo yum install -y openssl-devel
# erlang
wget http://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
cd ~
# elixir
wget https://github.com/elixir-lang/elixir/archive/v1.3.3.tar.gz
tar -zxvf v1.3.3.tar.gz
cd elixir-1.3.3/
make
echo "PATH=\$PATH:/home/ec2-user/elixir-1.3.3/bin" >> ~/.bashrc
exec $SHELL # reload the shell to pick up .bashrc change
cd ~
# phoenix deps
sudo yum install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs
mix local.hex --force
curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash -
sudo yum install -y nodejs
sudo npm -g install brunch
# listen on port 80 as well
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 4001
git clone https://github.com/troygnichols/bookmarks.git
cd bookmarks
mix deps.get
npm install
# make sure config/prod.secret.exs is in place
MIX_ENV=prod mix copmile
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 phoenix.server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment