Skip to content

Instantly share code, notes, and snippets.

View hanhdt's full-sized avatar
🌊

Hanh Tran hanhdt

🌊
View GitHub Profile
@hanhdt
hanhdt / 02_yarn_libs.config
Created April 21, 2018 10:43
Run Yarn install command via AWS Elastic Beanstalk hooks
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/101_yarn_packages.sh" :
mode: "000775"
owner: root
group: users
content: |
#!/usr/bin/env bash
app="$(/opt/elasticbeanstalk/bin/get-config container -k app_staging_dir)";
# npm install
@hanhdt
hanhdt / update_eb_platform.sh
Last active May 12, 2018 03:42
Update AWS Elastic Beanstalk Platform Version
# Use AWS CLI (Not EB CLI)
$aws elasticbeanstalk update-environment --solution-stack-name "64bit Amazon Linux 2017.09 v2.7.2 running Ruby 2.5 (Puma)" --environment-name "website-dev" --region "us-west-2"
@hanhdt
hanhdt / xray_on_elastic_beanstalk.config
Created October 16, 2018 00:14
A sample AWS XRay on Elastic Beanstalk instance
commands:
01-stop-tracing:
command: yum remove -y xray
ignoreErrors: true
02-copy-tracing:
command: curl https://s3.dualstack.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-2.x.rpm -o /home/ec2-user/xray.rpm
03-start-tracing:
command: yum install -y /home/ec2-user/xray.rpm
files:
@hanhdt
hanhdt / 03_elastic_beanstalk_nginx.config
Last active March 31, 2021 18:41
Overwriting Nginx config on AWS Elastic Beanstalk
files:
"/etc/nginx/conf.d/01_app_server.conf":
mode: "000644"
owner: root
group: root
content: |
# The content of this file is based on the content of /etc/nginx/conf.d/webapp_healthd.conf
upstream website_upstream {
server unix:///var/run/puma/my_app.sock;
}
@hanhdt
hanhdt / 01_elastic_beanstalk_install_packages.config
Last active August 15, 2023 17:00
Setup additional linux packages on AWS Elastic Beanstalk that need to build Rails 5
# Setup linux packages
option_settings:
- option_name: BUNDLE_DISABLE_SHARED_GEMS
value: "1"
- option_name: BUNDLE_PATH
value: "vendor/bundle"
packages:
yum:
curl: []