Skip to content

Instantly share code, notes, and snippets.

@bangpound
Created April 30, 2014 05:04
Show Gist options
  • Save bangpound/f3283c44bf234e118561 to your computer and use it in GitHub Desktop.
Save bangpound/f3283c44bf234e118561 to your computer and use it in GitHub Desktop.
Run Drupal on Heroku

The filesystem in heroku is read-only and ephemeral! This is not the Drupal hosting platform of your dreams!

git clone --branch 7.x-pimple https://github.com/bangpound/drupal.git
cd drupal
heroku create
composer install
git add composer.lock
git commit -m "add composer.lock"
heroku addons:add heroku-postgresql
heroku config

Note the password because you have to enter it multiple times during installation.

DATABASE_URL=`heroku config:get DATABASE_URL`
vendor/bin/drush site-install minimal --db-url=pgsql://${DATABASE_URL:11} --site-name=Herokupal
git add -f sites/default/settings.php
git commit -m "add settings.php"

In all your front controllers, include the Composer autoloader after DRUPAL_ROOT is defined:

require_once DRUPAL_ROOT . '/vendor/autoload.php';

Modify authorize.php cron.php index.php install.php update.php xmlrpc.php modules/statistics/statistics.php

git add -u
git commit -m "include composer autoloader."
git push heroku HEAD:master
heroku open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment