- Install
vagrant
to run Debian in a VM - Bootstrap Dokku
wget https://raw.githubusercontent.com/dokku/dokku/v0.21.4/bootstrap.sh sudo DOKKU_TAG=v0.21.4 bash bootstrap.sh
- Web setup
- Add ssh key for admin access
- Name remote
- Install heroku-buildpack-php
Probably unnecessary (default, or already installed)
dokku buildpacks:add php https://github.com/heroku/heroku-buildpack-php.git
- Install dokku-mysql
Probably unnecessary (already installed)
sudo dokku plugin:install https://github.com/dokku/dokku-mysql.git
dokku apps:create q2a
# Define port, mapping from external to internal
# Using 80 as an example
dokku proxy:ports-add q2a http:80:5000
Initialised with mysql
, but also works with mariadb
and others.
dokku mysql:create q2a
dokku mysql:link q2a q2a
# Obtain auth-info
dokku mysql:info q2a --dsn
# Retrieve password from output, e.g. `mysql://mysql:$PASSWORD@dokku-mysql-q2a:3306/q2a`
# Replace $PASSWORD with the retrieved value
dokku config:set q2a DATABASE_PASSWORD='$PASSWORD'
- Download the latest release
- Unzip in a folder
- Init git repo
- Init
composer.json
, required for dokku containersecho '{}' > composer.json
- Init
qa-config.php
mv qa-config-example.php qa-config.php
- Modify
qa-config.php
with the database info obtained in the previous step:... define('QA_MYSQL_HOSTNAME', 'dokku-mysql-q2a'); define('QA_MYSQL_PORT', '3306'); define('QA_MYSQL_USERNAME', 'mysql); define('QA_MYSQL_PASSWORD', getenv('DATABASE_PASSWORD')); define('QA_MYSQL_DATABASE', 'q2a'); ...
Note that
QA_MYSQL_PASSWORD
is retrieved from the app’sENV
(managed with dokku). - Add remote and push
git remote add dokku@server:q2a git push dokku master
- Configure via web-interface