Last active
August 13, 2019 10:38
-
-
Save padmick/27ccfffc3ea857c90f6fbbb1ef157fc3 to your computer and use it in GitHub Desktop.
testDeploy
This file contains 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
#!/bin/bash | |
export DEBIAN_FRONTEND=noninteractive | |
sudo gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | |
\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.6.3 | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs && | |
sudo DEBIAN_FRONTEND=noninteractive ln -sf /usr/bin/nodejs /usr/local/bin/node | |
export DEBIAN_FRONTEND=noninteractive | |
# Install our PGP key and add HTTPS support for APT | |
sudo DEBIAN_FRONTEND=noninteractive apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7 | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https ca-certificates | |
# Add our APT repository | |
sudo DEBIAN_FRONTEND=noninteractive sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list' | |
sudo DEBIAN_FRONTEND=noninteractive apt-get update | |
# Install Passenger + Nginx | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nginx | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nginx-extras passenger | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libmysqlclient-dev | |
conf="user www-data; | |
worker_processes auto; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} | |
http { | |
## | |
# Basic Settings | |
## | |
sendfile on; | |
tcp_nopush on; | |
tcp_nodelay on; | |
keepalive_timeout 65; | |
types_hash_max_size 2048; | |
# server_tokens off; | |
# server_names_hash_bucket_size 64; | |
# server_name_in_redirect off; | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
## | |
# SSL Settings | |
## | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE | |
ssl_prefer_server_ciphers on; | |
## | |
# Logging Settings | |
## | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
## | |
# Gzip Settings | |
## | |
gzip on; | |
gzip_disable "msie6"; | |
# gzip_vary on; | |
# gzip_proxied any; | |
# gzip_comp_level 6; | |
# gzip_buffers 16 8k; | |
# gzip_http_version 1.1; | |
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; | |
## | |
# Phusion Passenger config | |
## | |
# Uncomment it if you installed passenger or passenger-enterprise | |
## | |
include /etc/nginx/passenger.conf; | |
## | |
# Virtual Host Configs | |
## | |
include /etc/nginx/conf.d/*.conf; | |
include /etc/nginx/sites-enabled/*; | |
} | |
" | |
sudo DEBIAN_FRONTEND=noninteractive sh -c "echo '$conf' > '/etc/nginx/nginx.conf'" | |
gem install bundler | |
sudo DEBIAN_FRONTEND=noninteractive service nginx restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment