An application can also contain more than one buildpack. It can be achieved using add
:
heroku buildpacks:add --index 1 <buildpack_name>
where, --index
parameter specifies the execution order of buildpack.
Say,
heroku buildpacks:set heroku/php
heroku buildpacks:add --index 1 heroku/nodejs
will set the buildpack order as:
heroku/nodejs
heroku/php
Remember: A Heroku app has only one public port - 80. Hence either of the one will serve in one port. Say, if procfile
is specified with web: node server.js
, node application will run in port 80, otherwise PHP. However, the build will run in the order specified. If one needs more than one application, set up multiple projects and make it to communicate with each other.