Heroku Buildpacks in Docker Images
I think Cloud Native Buildpacks are what you're in need of. Cloud Native Buildpacks produce Docker images as output, which means you don't even need a Dockerfile
.
The heroku/buildpacks:18
CNB builder image includes the heroku/nodejs
buildpack. But you'll need to add the jemalloc buildpack manually. Since jemalloc is an old-style buildpack (i.e. not Cloud Naitve), you'll need to use the CNB shim. In this way you can reference the buildpack with this URL:
https://buildpack-registry.heroku.com/cnb/gaffneyc/jemalloc
All that said, and with the Pack CLI installed, you should be able to run:
$ pack build --builder heroku/buildpacks:18 --buildpack heroku/nodejs,https://buildpack-registry.heroku.com/cnb/gaffneyc/jemalloc my app