mepointo.nl

Dokku Cheatsheets

Setup
1 laravel new myapp --using=<starter-kit> copy
2 cd myapp copy
3 composer require remyhonig/laravel-dokku-preset copy
4 php artisan dokku:install copy
5 php artisan dokku:provision copy
Deploy
6 git add . && git commit -m "init" copy
7 git push dokku master --force copy
Debug
ssh dokku@mepointo.nl logs myapp -t copy
ssh dokku@mepointo.nl ps:report myapp copy
ssh -t dokku@mepointo.nl run myapp php artisan tinker copy
ssh -t dokku@mepointo.nl enter myapp copy
More...
Deploy Symfony applications to Dokku. Uses the PHP buildpack with nginx. Make sure you have the Symfony CLI installed locally.
Setup
1 symfony new myapp --webapp --version=lts copy
2 cd myapp copy
Configure for Dokku
3 composer require symfony/apache-pack copy
4 echo 'web: heroku-php-nginx public/' > Procfile copy
5 echo 'php 8.3' > .php-version copy
Create App on Dokku
6 ssh dokku@mepointo.nl apps:create myapp copy
7 ssh dokku@mepointo.nl buildpacks:set myapp https://github.com/heroku/heroku-buildpack-php copy
8 ssh dokku@mepointo.nl config:set myapp APP_ENV=prod APP_SECRET=$(openssl rand -hex 16) copy
9 git remote add dokku dokku@mepointo.nl:myapp copy
Deploy
10 git add . && git commit -m "init" copy
11 git push dokku master copy
Database (Optional)
ssh dokku@mepointo.nl postgres:create myapp-db copy
ssh dokku@mepointo.nl postgres:link myapp-db myapp copy
Debug
ssh dokku@mepointo.nl logs myapp -t copy
ssh dokku@mepointo.nl ps:report myapp copy
ssh -t dokku@mepointo.nl run myapp php bin/console copy
ssh -t dokku@mepointo.nl enter myapp copy
More...
Deploy static HTML/CSS/JS sites with nginx. Put your files in a folder and push to Dokku. Perfect for landing pages, documentation, or any static content.
Setup
1 mkdir myapp && cd myapp copy
2 echo '<h1>Hello World</h1>' > index.html copy
3 touch .static copy
4 git init && git add . && git commit -m "Initial commit" copy
Create App on Dokku
5 ssh dokku@mepointo.nl apps:create myapp copy
6 git remote add dokku dokku@mepointo.nl:myapp copy
Deploy
7 git add . && git commit -m "Initial commit" copy
8 git push dokku master copy
SSL (Optional)
9 ssh dokku@mepointo.nl letsencrypt:enable myapp copy
More...