DEV Community

Cover image for Working with Dokku
ILshat Khamitov
ILshat Khamitov

Posted on • Updated on

Working with Dokku

Site

http://dokku.viewdocs.io/dokku/

Connecting to the VPS

ssh root@255.255.255.255

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"

Creating an application

dokku apps:create www

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

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

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

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

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"

Restart applications

dokku ps: restart www

Discussion (0)