Skip to content

Instantly share code, notes, and snippets.

@silverbux
Last active November 27, 2015 01:53
Show Gist options
  • Save silverbux/f0b9af959f1ed98cc4b4 to your computer and use it in GitHub Desktop.
Save silverbux/f0b9af959f1ed98cc4b4 to your computer and use it in GitHub Desktop.
Setup dokku on digitalocean + install mongodb plugin + fix mongodb remote connection issues + fix digital ocean memory issues
#!/bin/bash
dokku plugin:install https://github.com/dokku/dokku-mongo.git mongo &&
docker pull mongo:2.6.11 &&
apt-get install -y mongodb-clients &&
echo 'export MONGO_CONFIG_OPTIONS=" --auth "' >> ~/.bashrc &&
echo 'export MONGO_IMAGE_VERSION="2.6.11"' >> ~/.bashrc &&
sudo swapon -s &&
sudo fallocate -l 4G /swapfile &&
ls -lh /swapfile &&
sudo chmod 600 /swapfile &&
ls -lh /swapfile &&
sudo mkswap /swapfile &&
sudo swapon /swapfile &&
sudo swapon -s &&
echo '/swapfile none swap sw 0 0' >> /etc/fstab &&
echo 'IMPORTANT: execute "source ~/.bashrc" to apply environment variables' &&
wait
echo 'yey!'
@silverbux
Copy link
Author

setup dokku plugins (mongodb) fix memory issues on digital ocean and fix mongodb versions

curl https://gist.githubusercontent.com/silverbux/f0b9af959f1ed98cc4b4/raw/33e2e9f89259e5607d03a03fb68d5d4e3166e2fb/dokku-setup.sh > dokku-setup.sh && chmod +x dokku-setup.sh 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment