Skip to content

zaeph/q2a-on-dokku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Setting up Q2A via a Dokku instance

Setting up Dokku

  1. Install vagrant to run Debian in a VM
  2. Bootstrap Dokku
    wget https://raw.githubusercontent.com/dokku/dokku/v0.21.4/bootstrap.sh
    sudo DOKKU_TAG=v0.21.4 bash bootstrap.sh
        
  3. Web setup
    • Add ssh key for admin access
    • Name remote
  4. Install heroku-buildpack-php Probably unnecessary (default, or already installed)
    dokku buildpacks:add php https://github.com/heroku/heroku-buildpack-php.git
        
  5. Install dokku-mysql Probably unnecessary (already installed)
    sudo dokku plugin:install https://github.com/dokku/dokku-mysql.git
        

Prepare containers for Q2A

Q2A

dokku apps:create q2a

# Define port, mapping from external to internal
# Using 80 as an example
dokku proxy:ports-add q2a http:80:5000

MySQL database

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'
  1. Download the latest release
  2. Unzip in a folder
  3. Init git repo
  4. Init composer.json, required for dokku containers
    echo '{}' > composer.json
        
  5. Init qa-config.php
    mv qa-config-example.php qa-config.php
        
  6. 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’s ENV (managed with dokku).

  7. Add remote and push
    git remote add dokku@server:q2a
    git push dokku master
        
  8. Configure via web-interface

About

Setting up Q2A via a Dokku instance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published