How to specify heroku buildpacks to use?
I tried adding this to an app.json as described here https://devcenter.heroku.com/articles/app-json-schema#buildpacks
but it had no effect
app.json Schema | Heroku Dev Center
app.json is a manifest format for describing web apps. It declares environment variables, add-ons, and other information required to deploy and run an app on Heroku.
33 Replies
is there a reasson you are specifying a buildpacks?
the heroku buildpacks already have all the engines installed
Yes there is, the "auto detection" uses
===> DETECTING
3 of 5 buildpacks participating
heroku/nodejs-engine 3.2.15
heroku/ruby 3.0.0
heroku/procfile 3.1.2
Thing is nodejs-engine is not same as the nodejs build pack. It ends up failing on "pnpm is not a known command"
More specificallyt
- Running
bundle exec rake assets:precompile --trace
Invoke assets:precompile (first_time)
Invoke vite:install_dependencies (first_time)
Invoke js:routes:typescript (first_time)
Invoke js:routes (first_time)
Invoke environment (first_time)
Execute environment
Execute js:routes
Execute js:routes:typescript
Execute vite:install_dependencies
Invoke vite:build_all (first_time)
Invoke vite:verify_install (first_time)
Invoke environment
Execute vite:verify_install
Execute vite:build_all
Building with Vite ā”ļø
rake aborted!
ViteRuby::MissingExecutableError: ā The vite binary is not available. Have you installed the npm packages? (ViteRuby::MissingExecutableError)
...
...
Caused by:
Errno::ENOENT: No such file or directory - pnpm (Errno::ENOENT)mmm I'm not familiar with ruby, let me see if there is any way to specify a custom file
On heroku and also dokku it is enough to just specify those buildpacks to get a working deployment
I sometimes also use custom buildpacks for dependencies like libvips, puppeteer, aptfile, etc. š
the thing is we use buildpacks
https://buildpacks.io/docs/for-app-developers/how-to/build-inputs/configure-build-time-environment/#using-project-descriptor
which internally allows to use multiple builders including heroku packs, but I cannot find information how we specify the app.json to the builder
the only thing similar is this
https://buildpacks.io/docs/for-app-developers/how-to/build-inputs/use-project-toml/
which you can specify, builders and more things, I'm not very familiar with that
Cloud Native Buildpacks
Customize buildpack behavior with build-time environment variables ...
Environment variables are a common way to configure various buildpacks at build-time.
probably dokku use the heroku cli directly, that's why it recognize the app.json automatically
Oh actually with dokku I use
dokku buildpacks:set --index 1 https://github.com/heroku/heroku-buildpack-nodejs.git
and then index 2 for the ruby buildpacki.e

according to the docs from heroku/buildpacks you can use the project.toml
https://github.com/heroku/buildpacks/blob/main/TUTORIAL.md#configuring-multiple-languages
GitHub
buildpacks/TUTORIAL.md at main Ā· heroku/buildpacks
Heroku Cloud Native Buildpacks. Contribute to heroku/buildpacks development by creating an account on GitHub.
and there you can specify multiples buildpacks
Thanks! Just tested it didn't make any difference
Hey nevermind it did do something
what did you do?

I added this to the root
I though it didn't work because the output during build is now
===> DETECTING
heroku/nodejs-engine 3.2.15
heroku/nodejs-corepack 3.2.15
heroku/nodejs-pnpm-install 3.2.15
heroku/ruby 3.0.0
is the project.toml?
Yes š
Nicee
The deployment was successful but it seems to app is not being executed properly
can you check the logs?

I am not sure what command it's trying to run
I do have the following procfile

I added PORT=3000 in environment variables and it appears to have fixed it!
I don't think the worker is running though. Do you know if it's possible to run it? Typically would be
dokku ps:scale web=1 worker=1
with dokkuI'm not familiar with dokku in that way, what makes dokku when you run that command>?
It reads my Procfile and starts process accordingly
When I do
docker ps
I can see both web and worker command executing in a docker (one docker for each)
The release
process is ran only once during the deployment at the end, it's used to execute database migration, this is how Heroku says to do. It appears it didn't run in my case with Dokploy
Opening a terminal session or runnign docker exec -it <container id> bash
won't let me do anything either. ruby, bundle, etc. are all "command not found"
Got it ! Running /cnb/lifecycle/launcher bash
gives you a proper sourced environment š At least I could manually run migrations for nowIām not familiar with that tbh š¤£, but happy you found a solution
Me neither! At first I though it was all different because I was using Dokploy but it's simply because it's using Heroku Cloud Native Buildpack
The way it works is completly different
It's up and running but couldn't find how to tell to run the worker from the procfile but I do see it detected
Documentation says
heroku ps:scale worker =1
But that command doesn't exist
dokku ps:scale worker = 1
is the dokku equivalentI guess scale is something specific to heroku platform
you can scale aplications in dokploy, in advanced -> cluster -> set replicas
I don't know if is the same thing
but basically it creates multiples replicas of the same app
In my case it needs to run same docker image but with a different start command
I'm gonna call it a night for now š Thanks for the quick help! Have a good night
@Siumauricio can add at least app.json read capabilities to read Heroku build pack version,
Currently Dokploy using Heroku build pack version 24
But I want 22
Or you can add additional options during selecting build pack
Like when we select Dockerfile as build type,
There are many additional options,
You can add an option like the Heroku version to configure the Heroku build pack version

GitHub
dokploy/apps/dokploy/server/utils/builders/heroku.ts at 610ef8f35c7...
Open Source Alternative to Vercel, Netlify and Heroku. - Dokploy/dokploy