Skip to content

Instantly share code, notes, and snippets.

@diegochavez
Forked from fightingtheboss/configuration.yml
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegochavez/e047330fa815e700bbc1 to your computer and use it in GitHub Desktop.
Save diegochavez/e047330fa815e700bbc1 to your computer and use it in GitHub Desktop.
packages:
yum:
git: []
files:
/opt/elasticbeanstalk/hooks/appdeploy/pre/51install_meteor.sh:
mode: "000755"
user: root
group: root
encoding: plain
content: |
#!/usr/bin/env bash
echo !!! Setting up METEOR dependencies
export PATH=$PATH:/usr/local/bin
echo !!! Set PATH: $PATH
ln -s /opt/elasticbeanstalk/node-install/node-v0.8.21-linux-x64/bin/node /usr/local/bin/node
ln -s /opt/elasticbeanstalk/node-install/node-v0.8.21-linux-x64/bin/node-waf /usr/local/bin/node-waf
ln -s /opt/elasticbeanstalk/node-install/node-v0.8.21-linux-x64/bin/npm /usr/local/bin/npm
echo !!! Installing Meteor
export HOME=/home/ec2-user
curl https://install.meteor.com | sh
echo !!! Installing Meteorite
npm install -g meteorite
echo !!! Creating app bundle
cd /tmp/deployment/application
mrt bundle bundle.tgz
tar xfz bundle.tgz
rm -rf bundle.tgz
cd /usr/local/bin
rm mrt npm node-waf node
container_commands:
01_nginx_worker_processes:
command: "sed -i 's/^\s*\(worker_processes\s*\)\d*.*$/\14;/' /tmp/deployment/config/#etc#nginx#nginx.conf"
02_nginx_worker_rlimit:
command: "sed -i '/^\(\(\s*\)worker_processes\s*\)\d*.*$/a worker_rlimit_nofile 8192;' /tmp/deployment/config/#etc#nginx#nginx.conf"
03_nginx_worker_connections:
command: "sed -i 's/^\(\s*worker_connections\s*\)\d*.*$/\14096;/' /tmp/deployment/config/#etc#nginx#nginx.conf"
04_nginx_keepalive_timeout:
command: "sed 's/^\(\s*keepalive_timeout\s*\)\d*.*$/\130;/' /tmp/deployment/config/#etc#nginx#nginx.conf"
05_nginx_gzip:
command: |
sed '/upstream/i \
gzip on;\
gzip_comp_level 6;\
gzip_vary on;\
gzip_min_length 1000;\
gzip_proxied any;\
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;\
gzip_buffers 16 8k;\
' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf
06_nginx_static:
command: |
sed '/\s*location\s*\/.*/i \
location ~ ^/(images/|img/|javascript/|js/|css/|stylesheets/|font/|fonts/|flash/|media/|static/|robots.txt|humans.txt|favicon.ico) {\
root /var/app/current/bundle/static;\
access_log off;\
expires max;\
}\
\
location ~* \.(js|css)$ {\
root /var/app/current/bundle/static_cacheable;\
access_log off;\
expires max;\
}\
' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf
option_settings:
- option_name: ROOT_URL
value: http://pegleg.it
- option_name: MONGO_URL
value: mongodb://<user>:<password>@<mongo-server:port>/<db-name>
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: NodeCommand
value: node bundle/main.js
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: NodeVersion
value: 0.8.21
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: GzipCompression
value: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment