Created
July 3, 2018 11:22
-
-
Save clausd/b1758df23403b86083ce6f70fef0101b to your computer and use it in GitHub Desktop.
Flask on Dokku on Digitalocean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install the Dokku droplet - smallest possible digitalocean vm works fine | |
Make sure you add your ssh key so you can git over ssh and ssh into the image later | |
* On the image be sure to NOT set up IPv6 | |
Boot the image - note the ip | |
Add a star alias on some domain you control and point it at that ip address - this lets you dokku up a lot of projects at somedomain.yourdomain.com | |
Go to http://[your IP address] to finalize dokku setup - set up virtual domains to make use of the star alias you just made | |
* You need to add your ssh public key here as well | |
* You CANNOT just add your key to authorised_keys - you need to use sshcommand - this enables the whole 'push to deploy' workflow | |
Follow the Flask-y steps here https://www.linode.com/docs/applications/containers/deploy-a-flask-application-with-dokku/ | |
== communication between nodes | |
As you add auxiliary services you might want them to communicate. All containers in one Dokku app are created on the same network | |
- but they are unaware of each other's IP addresses and there's no DNS - that requires a user defined network (https://github.com/dokku/dokku/issues/2085) | |
I added a shared mount for communicating configuration data using | |
dokku mount | |
and wrote a small script so each container is able to dump it's own location on disk so the other can read it. I include the script. |
Some experiences: Had a couple of botched updates due to network failure. This out Dokku on the fritz - bad state I could not retry my way out of. Fixed via a reboot. Which introduced the OTHER and NEW problem of Dokku not correctly killing old docker containers - so they all of a sudden rebooted as well - consuming all system resources. Had to kill all of these manually.
docker stop IDORNAME
docker rm IDORNAME
and of course while trying not to kill the actual stuff I had running.
I've also experienced failure to properly come up after reboot - had to do a
dokku ps:restart APPNAME
before the thing would run.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't forget to dokku ps:scale all your procs