I'm working on phasing this out of all my CraftCMS projects, so it won't be getting any updates, and may not workin the future. You probably should't use it.
DISCLAIMER: This is not supported code, use at your own risk.
This is a helper buildpack for installing and keeping an updated version of CraftCMS without committing it to your repo.
Ensure that you're using the default Craft folder structure:
app/
craft/
public/
Also ensure that you have a db.php
in your craft/config
directory.
Add this buildpack as the last buildpack in your heroku settings, after heroku/php
heroku buildpacks:set heroku/php
heroku buildpacks:add --index 1 https://github.com/dictions/heroku-buildpack-craftcms
Buildpack Requirements
This buildpack just manages Craft installation. As such, it relies on the
heroku/php
buildpack for PHP, Composer, and NGINX.
Add a Procfile in your app's root directory:
web: bin/start.sh
Add a composer.json file in your app's root directory:
{
"require": {
"php": "^5.3.0",
"ext-mbstring": "*",
"ext-imagick": "*"
},
"require-dev": {
"heroku/heroku-buildpack-php": "*"
}
}
You can configure the version of CraftCMS you need via CRAFT_VERSION
and CRAFT_BUILD
environment variables.
Improvements to be made later.
- Better Procfile detection. Right now there will always be a Procfile in the root because of
heroku/php
. - Better support for choosing between NGINX/Apache
- Install needed dependencies & composer plugins autonomously. I don't think composer.json is actually installing dependencies because composer runs before the Craft buildpack.