Skip to content

Instantly share code, notes, and snippets.

View maxarouca's full-sized avatar

Max Arouca maxarouca

View GitHub Profile
2gua.rainbow-brackets
adampalhazi.vscode-debug-arrow-function
alexcvzz.vscode-sqlite
alfnielsen.vsc-organize-imports
aliariff.auto-add-brackets
andys8.jest-snippets
antfu.iconify
antfu.vite
apollographql.vscode-apollo
arcticicestudio.nord-visual-studio-code
{
"git.enableSmartCommit": true,
"workbench.editor.decorations.colors": true,
"editor.minimap.enabled": false,
"editor.accessibilitySupport": "off",
"zenMode.hideLineNumbers": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"tailwindCSS.includeLanguages": {
"typescriptreact": "html",
"plaintext": "html",
@maxarouca
maxarouca / string-utils.js
Created April 3, 2020 12:22 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
// String utils
//
// resources:
// -- mout, https://github.com/mout/mout/tree/master/src/string
/**
* "Safer" String.toLowerCase()
*/
function lowerCase(str) {
return str.toLowerCase();

DigitalOcean Dokku / Node.js Cloud Environment

Custom recipe to get full Node.js Cloud Environment in DigitalOcean Dokku droplet running from scratch. Yes. Your own Heroku for $5 per month.

I use this gist to keep track of the important configuration steps required to have a functioning system after fresh install.

When you have executed that's all step by step you will get a new working and stable system which is ready to host & serve your Node.js application and databases.

@maxarouca
maxarouca / dokku-node-mongo.md
Created March 12, 2019 17:44 — forked from fizerkhan/dokku-node-mongo.md
NodeJS and MongoDB app in Dokku with Digital Ocean

Steps:

  1. Create Digital Ocean Droplet with Dokku v0.3.16 on 14.04 image

  2. Login into the droplet and Update local settings.

    sh -c "echo 'LANG=en_US.UTF-8\nLC_ALL=en_US.UTF-8' > /etc/default/locale"
    reboot

Setting up Heroku like deployment is pretty easy. There are lot of reasons why to do this but a big one specifically is cost. Heroku is expensive compared to a $20 DigitalOcean droplet. Of course, learning how to be a system administrator is required but not at all difficult.

In this series of how-to's, we'll be starting off deploying a Ruby on Rails app using a DigitalOcean droplet, Ubuntu, Docker and Dokku all for $5 a month that can easily be scaled to $20 a month (recommended for production apps).

Setup a Droplet

  1. Don't have a DigitalOcean account, create one.

  2. Create a droplet:

  3. Select the One-click Apps tab:

  • Choose an image - Dokku 0.7.2 on 16.04
@maxarouca
maxarouca / how-to-git-push-to-dokku-droplet-mac.md
Created March 12, 2019 14:39 — forked from john-doherty/how-to-git-push-to-dokku-droplet-mac.md
How to git push to a Dokku Droplet from a Mac

Digital Ocean Droplet

Digital Ocean offers a pre-installed Dokku image. You can run this image on any sized droplet, although larger droplets will allow you to run larger applications.

When choosing your Droplet configuration please disable IPv6. There are known issues with IPv6 on Digital Ocean and Docker, and many have been reported to the Dokku issue tracker. If you would like to run Dokku on an IPv6 Digital Ocean Droplet, please consult this guide.

Dokku setup using a Mac

  1. Login to your Digital Ocean account
@maxarouca
maxarouca / node-mongo-dokku-aws-ec2.md
Created March 12, 2019 14:38 — forked from markusdosch/node-mongo-dokku-aws-ec2.md
Node.js App with MongoDB on Dokku (hosted on Amazon EC2)
  1. Create an Ubuntu Server 14.04 LTS Instance (I typically use "Spot Requests" for machines which do not need to stay alive for a long time)
  • Configure Security Groups (inbound rules): All Traffic - All - All - 0.0.0.0/0; SSH - TCP - 22 - 0.0.0.0/0
  • Launch instance
  1. Connect to the instance via PuTTY
  • Host Name: ubuntu@<The Public DNS (see description of the instance)>
  • Connection -> SSH -> Auth -> Authentification parameters -> Select the *.ppk key pair file
  • Open Connection & accept fingerprint
  1. Install Dokku (source: http://dokku.viewdocs.io/dokku/installation/)
  • wget https://raw.githubusercontent.com/dokku/dokku/v0.4.13/bootstrap.sh
  • sudo DOKKU_TAG=v0.4.13 bash bootstrap.sh
Welcome
#Deplyoing to Production
## Deployment using dokku (docker manager)
*The current way of setting up the server requires knowledge with following:*
- *Git*
- *docker*
@maxarouca
maxarouca / dokku.md
Created March 12, 2019 14:37 — forked from chemicalkosek/dokku.md
Dokku

Dokku

Creating dokku app

Create the application on the Dokku host. You will need to ssh onto the host to run this command.

 # on the Dokku host
 dokku apps:create my-app-name

Deploy the app

Now you can deploy the my-app-name app to your Dokku server. All you have to do is add a remote to name the app. Applications are created on-the-fly on the Dokku server.