Last active
July 9, 2019 21:22
-
-
Save vladimir-e/ff16f745f5e784792f5647d9e18d0d39 to your computer and use it in GitHub Desktop.
Elixir machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://medium.com/coletiv-stories/how-to-automate-your-elixir-projects-deployment-into-aws-9ecbbafb403d | |
# production server | |
sudo vim /etc/default/locale | |
LANG="en_US.UTF-8" | |
LANGUAGE="en_US.UTF-8" | |
LC_ALL="en_US.UTF-8" | |
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 -y esl-erlang unzip nginx | |
# + build server requirements | |
sudo apt-get install -y elixir | |
mix local.hex --force | |
mix local.rebar --force | |
# Git | |
sudo apt-get install git | |
# Node | |
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh | |
sudo bash nodesource_setup.sh | |
sudo apt-get install -y nodejs | |
# Yarn | |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | |
sudo apt update | |
sudo apt install yarn | |
# nginx log rotation | |
sudo apt-get install nginx | |
sudo vim /etc/logrotate.d/nginx | |
/var/log/nginx/*.log { | |
daily | |
missingok | |
rotate 7 | |
maxage 7 | |
compress | |
delaycompress | |
notifempty | |
create 0640 www-data adm | |
sharedscripts | |
prerotate | |
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ | |
run-parts /etc/logrotate.d/httpd-prerotate; \ | |
fi \ | |
endscript | |
postrotate | |
[ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid` | |
endscript | |
} | |
# certbot | |
sudo add-apt-repository ppa:certbot/certbot | |
sudo apt-get update | |
sudo apt-get install python-certbot-nginx | |
# Please replace example.com by your domain | |
sudo certbot --nginx -d example.com -d www.example.com | |
sudo certbot renew --dry-run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment