DEV Community

Cover image for Working with Dokku
ILshat Khamitov
ILshat Khamitov

Posted on • Edited on

Working with Dokku

Site

http://dokku.viewdocs.io/dokku/
Enter fullscreen mode Exit fullscreen mode

Connecting to the VPS

ssh root@255.255.255.255
Enter fullscreen mode Exit fullscreen mode

Add ssh key to remote if need

ssh-keygen
cat "~/.ssh/id_rsa" | ssh root@255.255.255.255 "cat >> ~/.ssh/authorized_keys"
ssh root@255.255.255.255
exit
cat ~/.ssh/id_rsa.pub | ssh root@255.255.255.255 "sudo sshcommand acl-add dokku dokku"
Enter fullscreen mode Exit fullscreen mode

Creating an application

dokku apps:create www
Enter fullscreen mode Exit fullscreen mode

Connecting / deleting / dispatch to a remote git repository

git remote add public dokku@255.255.255.255: www
git remote remove public
git push public master
Enter fullscreen mode Exit fullscreen mode

configuration Installation

dokku config:set www EMAIL_IMAP_USE_TLS=1 --no-restart
dokku config:set www EMAIL_IMAP_HOST=imap.yandex.ru --no-restart
dokku config:set www EMAIL_IMAP_PORT=993
Enter fullscreen mode Exit fullscreen mode

Connecting Postgres

dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
dokku postgres:create www postgres://postgres: secret_key@dokku-postgres-www:5432/www
dokku config: set www DATABASE_URL=postgres://postgres:password@255.255.255.255:5432/www
Enter fullscreen mode Exit fullscreen mode

Domain Name Rebinding

dokku domains:clear
dokku domains:clear other-domain
dokku domains:clear www
dokku domains:add www main-domain.name
dokku domains:add domain2 other-domain.name
dokku domainswww
dokku domainsother-domain
Enter fullscreen mode Exit fullscreen mode

Connecting and disconnecting a folder

dokku run mkdir/home/dokku/logs/ myapp
dokku docker-options: add myapp deploy, run "-v/home/dokku/logs/myapp:/app/logs"
dokku docker-options: remove myapp deploy,run"-v /home/dokku/logs/myapp:/app/logs"
Enter fullscreen mode Exit fullscreen mode

Restart applications

dokku ps: restart www
Enter fullscreen mode Exit fullscreen mode

Top comments (0)