Skip to content

Instantly share code, notes, and snippets.

@natanlao
Last active March 30, 2021 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natanlao/e377128bb9a849a1bc535953a70a5855 to your computer and use it in GitHub Desktop.
Save natanlao/e377128bb9a849a1bc535953a70a5855 to your computer and use it in GitHub Desktop.
Dokku reference

I host side projects on a DigitalOcean droplet running Dokku. For reference:

One-time setup of Lets Encrypt

$ ssh root@platform.natan.la sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
$ ssh dokku@platform.natan.la dokku letsencrypt:cron-job --add

Creating an app

With a Dockerfile or Procfile:

$ ssh dokku@platform.natan.la apps:create $NAME
$ git remote add dokku dokku@platform.natan.la:$NAME
$ git push dokku master
$ ssh dokku@platform.natan.la config:set--no-restart $NAME DOKKU_LETSENCRYPT_EMAIL=${NAME}@natan.la
$ ssh dokku@platform.natan.la letsencrypt $NAME

Remember to map the subdomain with an A record to the droplet.

Add SSH key

$ ssh root@platform.natan.la sudo dokku ssh-tags:add github-deploy < id_ed25519.pub

Looking forward

Ideally, projects with a Dockerfile should be built "locally" (i.e., not on the droplet) since the droplet isn't particularly powerful.

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