PHP application with Node.js

There are some cases where a PHP application uses also some Node.js. It is for example the case if you use webpack to bundle the assets. In this case, one should use multi buildpacks along with a specific branch of the PHP buildpack. Here is how to do that.

In order to use multi buildpacks, you need to specify the BUILDPACK_URL environment variable. Head to the web dashboard or use our CLI:

scalingo env-set BUILDPACK_URL=

Then add a file named .buildpacks at the root of your application containing (the order of the two lines is important):

Eventually, define the environment variable PHP_BUILDPACK_NO_NODE=true in your application.

With this setup, Scalingo will first execute the PHP buildpack without the basic Node.js support it embeds (the branch nonode), then the Node.js buildpack will execute yarn install and yarn build.

mode_edit Suggest edits