-
Notifications
You must be signed in to change notification settings - Fork 12
/
ubuntu.sh
55 lines (43 loc) · 1.6 KB
/
ubuntu.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
48
49
50
51
52
53
54
55
#!/bin/bash
# This script is for deploying Memoet to Ubuntu 18.04 server, use it at your own risk
sudo apt update
# Rust
sudo apt install -y build-essential
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Elixir
wget -O- https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | sudo apt-key add -
echo "deb https://packages.erlang-solutions.com/ubuntu bionic contrib" | sudo tee /etc/apt/sources.list.d/rabbitmq.list
sudo apt update
sudo apt install esl-erlang
sudo apt install elixir
# Node
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
# Postgres
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt install postgresql-13
# Postgres create user
# sudo -u postgres psql
# create database memoet;
# create user memoet with encrypted password 'memoet';
# grant all privileges on database memoet to memoet;
# Power to open lower ports (80)
# sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/lib/erlang/erts-11.1.7/bin/beam.smp
# Clone
git clone https://github.com/memoetapp/memoet.git
cd memoet/
mix deps.get
MIX_ENV=prod mix compile
# In assets folder
# npm install
# npm run deploy
mix phx.digest
MIX_ENV=prod mix ecto.migrate
# Start!
# Interactive mode
# PORT=80 MIX_ENV=prod mix phx.server --no-compile
PORT=80 MIX_ENV=prod elixir --erl "-detached" --sname server -S mix phx.server --no-compile
# Connect to running process
iex --sname console --remsh server