Public | Automated Build

Last pushed: 8 months ago
Short Description
Image for DK Fitness Tracking App
Full Description

README

To Install

Damien Kelly Fitness Workout Tracker

  • Track Damien Kelly's unique workouts with this custom tracker created specifically for DK's brand of fitness
  • Version 2.3

Steps to renew SSL cert

  • ssh -i ~/.ssh/dk_fitness_tracker_production.pem ubuntu@52.62.139.201
  • ./certbot-auto renew
  • sudo tar -cvvf ~/letsencrypt_<DATE>.tar /etc/letsencrypt
  • sftp -i ~/.ssh/dk_fitness_tracker_production.pem ubuntu@52.62.139.201
  • get ~/letsencrypt_<DATE>.tar
  • mv letsencrypt_<DATE>.tar ../../dkProdDeploy/
  • cd ../../dkProdDeploy
  • tar -xvf letsencrypt_<DATE>.tar
  • cd ../dkfitness/.deploy
  • mup setup
  • mup deploy

To backup the database to S3 using a Lambda function

  • Compile code below on the same AMI being used to run lambda function
  • sftp tarball of code and node_modules directory back to local machine
  • create zip from tarball and upload to Lambda
#!javascript

exports.handler = function (event, context) {
  var mongoBackup = require('mongo-backup-to-s3');
  var config = {
      mongodb:{
          url:  'mongodb://<dbuser>:<dbpwd>@<db_url>'
      },
      s3:{
          bucket:'<s3_bucket_name>',
          folder:'<s3_folder_name>',
          key: '<s3_bucket_key>',
          secret: '<s3_bucket_secret>'
      }
  };
  console.log(mongoBackup.dumpToS3(config));
}

To restore mongodb from dmp file generated by Lambda function above

#!javascript

npm install mongo-dump-stream

Then in shell:

cat db_dump_file.dmp | node mongo-load-stream.js mongodb://usr:pass@db_url/db_name

Full instructions here

Docker Pull Command
Owner
jonathangolan
Source Repository

Comments (0)