Skip to content

Instantly share code, notes, and snippets.

@eikes
Created December 29, 2015 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eikes/789c86bd9c5b94352196 to your computer and use it in GitHub Desktop.
Save eikes/789c86bd9c5b94352196 to your computer and use it in GitHub Desktop.
run phoenix on ubuntu
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install git esl-erlang elixir postgresql nodejs nodejs-legacy npm
sudo npm -g install brunch@1
mix local.hex
mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.1.1/phoenix_new-1.1.1.ez
git clone https://github.com/eikes/phoenix_guides_server.git
cd phoenix_guides_server
mix deps.get
sudo npm install
brunch build --production
# Create the database
# Create config/prod.secret.exs
MIX_ENV=prod mix ecto.create
MIX_ENV=prod mix ecto.migrate
MIX_ENV=prod mix phoenix.digest
# Run
MIX_ENV=prod PORT=4001 elixir --detached -S mix do compile, phoenix.server
# Listen on port 80 as well
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 4001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment