Dokku
@dokku @docker @container
Persistent storage
http://dokku.viewdocs.io/dokku/advanced-usage/persistent-storage/
Dokku's default storage mount point in the container is /storage and I have no reason to change that. On the server, you want to create a folder for your app in:
$ sudo chown -R 32767:32767 /var/lib/dokku/data/storage/<appname>
Check that your storage is mounted correctly, then restart the container
$ dokku ps:rebuild <appname>
Configuring nginx to serve files on Dokku persistent storage
http://dokku.viewdocs.io/dokku/configuration/nginx/
To manually configure nginx to correctly serve your media files in the container. Copy the contents from here and paste them into a file called nginx.conf.sigil in your project root (where Procfile is). Look for loops with http and https conditionals, and before the first location / {...} statement for both http and https (where / means site root, add another location statement:
This will tell your nginx to serve files at yoursite.com/media from the path on the server (NOT container) that you want (in this case /var/lib/dokku/data/storage/<appname>
If using Django, remember to configure your MEDIA_URL
Telling Dokku to install a specific Python version
This is assuming you are using the official Python buildpack: https://github.com/heroku/heroku-buildpack-python.git
Create a file in your project root (where the Procfile is) called runtime.txt
Inside this, simply add the version of Python you want, e.g. python-3.8.2
Now, when you push your site, it will install the specific version of Python.
Add SSL certificates to your apps
https://github.com/dokku/dokku-letsencrypt
First, install the letsencrypt plugin:
Backing up postgres database
The general format is:
# To dump data:
$ dokku postgres:export <db_service> > <backupname>
# To import data:
$ dokku postgres:import <db_service> < <backupname>
For this you have to be using the dokku postgres plugin.