feature server packer: remove old .mp3 files periodically, build AMI with larger instance type for speed

This commit is contained in:
Dave Horton
2020-09-28 14:50:07 -04:00
parent 4abbac04aa
commit 58af90b07d
2 changed files with 6 additions and 3 deletions

View File

@@ -9,12 +9,15 @@ cd apps
git clone https://github.com/jambonz/jambonz-feature-server.git -b ${VERSION}
git clone https://github.com/jambonz/fsw-clear-old-calls.git
cd /home/admin/apps/jambonz-feature-server && npm install
cd /home/admin/apps/jambonz-feature-server && sudo npm install --unsafe-perm
cd /home/admin/apps/fsw-clear-old-calls && npm install && sudo npm install -g .
echo "0 * * * * root fsw-clear-old-calls --password JambonzR0ck$ >> /var/log/fsw-clear-old-calls.log 2>&1" | sudo tee -a /etc/crontab
echo "0 * * * * root fsw-clear-old-calls --password JambonzR0ck$ >> /var/log/fsw-clear-old-calls.log 2>&1" | sudo tee -a /etc/crontab
echo "0 1 * * * root find /tmp -name \"*.mp3\" -mtime +2 -exec rm {} \; > /dev/null 2>&1" | sudo tee -a /etc/crontab
sudo -u admin bash -c "pm2 install pm2-logrotate"
sudo -u admin bash -c "pm2 set pm2-logrotate:max_size 1G"
sudo -u admin bash -c "pm2 set pm2-logrotate:retain 5"
sudo -u admin bash -c "pm2 set pm2-logrotate:compress true"
sudo chown -R admin:admin /home/admin/apps

View File

@@ -3,7 +3,7 @@
"region": "us-east-1",
"ssh_username": "admin",
"ami_description": "jambonz feature server",
"instance_type": "t2.medium",
"instance_type": "t2.xlarge",
"drachtio_version": "develop",
"jambonz_version": "master"
},