cloudfoundry/cnb:bionic builder doesn't build the app

So I have a Strapi app that I’d like to deploy on Fly. First, I was trying to use heroku/buildpacks:20 but no luck here. I’m using yarn and heroku buildpack was trying to use npm, even though I do have only one lock file in the project - yarn.lock. So I decided to try cloudfoundry/cnb:bionic builder. But now I got another problem - this builder installs dependencies correctly, using yarn but it doesn’t seem to build the app. I do have an npm script inside my package.json called build. I saw that you can specify build script using BP_NODE_RUN_SCRIPTS argument for this buildpack. So I’ve added this to my fly.toml file. But still no luck, app doesn’t seem to build. Below is my fly.toml file.

# fly.toml file generated for exampe-app on 2021-11-16T09:42:48+01:00

app = "example-app"

kill_signal = "SIGINT"
kill_timeout = 5
processes = []

  builder = "cloudfoundry/cnb:bionic"


  PORT = "8080"

  allowed_public_ports = []
  auto_rollback = true

  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []

    hard_limit = 25
    soft_limit = 20
    type = "connections"

    handlers = ["http"]
    port = 80

    handlers = ["tls", "http"]
    port = 443

    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

Are there any logs that indicate what the actual problem is? It should also be possible to run the buildpacks outside of Fly like you would a Dockerfile using the pack command from — that should make it easy to figure out exactly what needs to be set and what’ll work, and then you can add that into the Fly config.

Thanks, I’ve tried running it locally but no luck. Had to change the builder to paketobuildpacks/builder:base. Seems to work fine.

1 Like

@sudhir.j unfortunately I was wrong.

pack build my-app --buildpack --builder paketobuildpacks/builder:base --env BP_NODE_RUN_SCRIPTS=build

So the above command works fine locally for me, it takes some time to build the app (about 20 minutes) but it works. And when I run fly deploy with the same builder paketobuildpacks/builder:base it hangs on yarn run build step, now it’s 25 minutes and counting. Seems really weird. I have no idea what might be causing this, was trying to search if anyone had a similar issue but no luck.

Can you try passing —local-only to fly deploy? That should tell us if the problem is network dependent.

1 Like

The same behavior occurs, it reached 25 minutes and is still on yarn run build step. There are no errors logs or any useful information in the output.