dokku-community / dokku-apt

Inject deb packages into dokku based on files in project
MIT License
128 stars 38 forks source link

apt-packages on an arm64 architecture using pack builder #52

Closed polgiron closed 2 weeks ago

polgiron commented 2 weeks ago

Hey, I'm trying to deploy my node js app on a raspberry pi 4.

My app requires the npm package "canvas", in order to install this package I need a few deb packages first. I've installed "pack-cli" on the ubuntu server because it is required for dokku to deploy app on an arm64 architecture.

I've installed this dokku plugin and have added the file "apt-packages" with the deb packages I need. When I'm trying to deploy the app, it is not trying to install any deb packages, and it jumps right away to the npm install part.

Do you know what I am doing wrong please?

josegonzalez commented 2 weeks ago

This plugin only supports herokuish-based deploys, not Cloud Native Buildpacks. You may want to look at something like adding this CNB buildpack to your app: https://github.com/cloudfoundry/apt-buildpack

polgiron commented 2 weeks ago

ok thanks for your answer, I've tried to add a file ".buildpacks" to the root of my repository, and I have added the line "https://github.com/cloudfoundry/apt-buildpack.git" into it, unfortunately I don't see any reference to this buildpack in the logs when I deploy the application, do you have any clue?

If I set the buildpack threw the env variable it doesn't seem to work either

dokku config:set photol-api BUILDPACK_URL=https://github.com/cloudfoundry/apt-buildpack.git

In the logs of the application deployment I get

===> DETECTING
3 of 5 buildpacks participating
heroku/nodejs-engine 3.3.0
heroku/nodejs-yarn   3.3.0
heroku/procfile      3.1.2
josegonzalez commented 1 week ago

Buildpacks for CNB work differently than for Herokuish - I should probably document this better...

For the moment, I believe you'll need to create a project.toml with the buildpacks you want to run (the apt one and probably the node one).

Example here: https://buildpacks.io/docs/for-app-developers/how-to/build-inputs/use-project-toml/

The nice thing is that you can test the builds by running pack build with the builder in question and that will simulate what we do as shown here.