Skip to content

DokkuInstall

James (ODSC) edited this page Jan 20, 2021 · 8 revisions

Installing on Dokku

This is work in progress instructions

Dokku requirements

Dokku needs some plugins:

dokku plugin:install https://github.com/dokku/dokku-postgres.git
dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
dokku plugin:install  https://github.com/dokku/dokku-rabbitmq.git rabbitmq

TODO that option to autorenew certs

Install

For every app run on Dokku server:

dokku apps:create APPNAME
dokku config:set APPNAME ON_HEROKU=1
dokku config:set APPNAME SECRET_KEY=?????????????????????
dokku postgres:create APPNAME-database
dokku postgres:link APPNAME-database APPNAME
dokku rabbitmq:create APPNAME-rabbitmq
dokku rabbitmq:link APPNAME-rabbitmq APPNAME -a CLOUDAMQP_URL

Then do a deploy - make sure your dev machine has it's SSH keys set up with Dokku correctly then in the git repo do

git remote add dokku dokku@SERVERNAME:APPNAME
git push dokku BRANCHNAME:master

Then run on Dokku server:

dokku config:set --no-restart APPNAME DOKKU_LETSENCRYPT_EMAIL=????????????????????????
dokku letsencrypt APPNAME
dokku ps:scale APPNAME web=1 worker=1

For all the superusers you need, run

dokku --rm-container run APPNAME python manage.py createsuperuser

Need to add types - run on server:

dokku postgres:connect APPNAME-database

Then run the SQL

INSERT INTO jsondataferret_type (public_id, title, created) VALUES ('project','Project',CURRENT_TIMESTAMP );
INSERT INTO jsondataferret_type (public_id, title, created) VALUES ('organisation','Organisation',CURRENT_TIMESTAMP );
INSERT INTO jsondataferret_type (public_id, title, created) VALUES ('fund','Fund',CURRENT_TIMESTAMP );

TODO this requires user interaction; can we run this as one bash command line? So we can script it later.

You need to configure cron, on the server, on user dokku, add to the crontab:

TODO

Set up other environment vars, S3, etc

TODO

Setup database exports and backups; run dokku postgres:export APPNAME > FILENAME and backup FILENAME.

Remove

Run on Dokku server:

dokku apps:destroy APPNAME
dokku postgres:destroy APPNAME-database
dokku rabbitmq:destroy APPNAME-rabbitmq

And remove cron entries.

Clone this wiki locally