How do you keep static files in a go app?

Hi,

I read here How to Build Go Apps with Paketo Buildpacks - Paketo Buildpacks that I have to include the directory that I want to keep as env with variable name BP_KEEP_FILES.

My toml file looks like:

[build]
  builder = "paketobuildpacks/builder:base"
  buildpacks = ["gcr.io/paketo-buildpacks/go"]

[env]
  BK_KEEP_FILES = "assets/*"
  PORT = "8080"

The deploy doesn’t break, nor I can see any message that is saying anything about BK_KEEP_FILES. Locally I can see the image imported without any issues.

Can you offer any advice?

Ok, I found this article: Run a Go App · Fly Docs
Where it is explained, but be mindful it’s a child of [build], needs to be nested:

[build]
  builder = "paketobuildpacks/builder:base"
  buildpacks = ["gcr.io/paketo-buildpacks/go"]
    
  [build.args]
    BP_KEEP_FILES = "assets/*:resources/*"

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.