0

I'm trying to create an app image for my laravel 10 app without writing a docker file with buildpack, I've reading the official docs using of paketo and discovered the build code

pack build my-app --buildpack paketo-buildpacks/php \
  --builder paketobuildpacks/builder:full

The problem is, laravel 10 is using node js too. is there's realy a way to build a laravel 10 app image using buildpack?

Amir
  • 86
  • 7

1 Answers1

1

The Paketo PHP buildpack doesn't include Node by default but you can provide the Paketo node-engine buildpack to the build. Due to the way buildpacks work, we need another buildpack to "require" Node, so you'd also likely have to add the build-plan buildpack to require Node.

Your build command would look like:

pack build my-app --buildpack paketo-buildpacks/php \
  --buildpack paketo-buildpacks/node-engine \
  --buildpack paketo-community/build-plan \
  --builder paketobuildpacks/builder:full

Then, you'd need to add a "plan.toml" file to your app to require Node as mentioned above. The requires.metadata section changes depending on whether you need Node during the build (build = true) or at run-time (launch = true):

[[requires]]
  name = "node"
  version = "<version constraint>"
[requires.metadata]
  launch = true

If this is a common use case, we could think about potentially adding first-class support for Node to the PHP buildpack in the future. Feel free to open an issue on GitHub at https://github.com/paketo-buildpacks/php to discuss this further.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83