Skip to content

Instantly share code, notes, and snippets.

@agracey
Last active July 8, 2022 18:15
Show Gist options
  • Save agracey/4c7596b9ba3c0ed38a0ff069751e50ff to your computer and use it in GitHub Desktop.
Save agracey/4c7596b9ba3c0ed38a0ff069751e50ff to your computer and use it in GitHub Desktop.
Language specific buildpack configuration options

All Languages

Any application can set variables through https://github.com/paketo-buildpacks/environment-variables

Any language can specify a launch configuration via Procfile which will override the language specific script detection.

Any language can specify labels to add to the image that's built: https://github.com/paketo-buildpacks/image-labels

  • BP_ENABLE_RUNTIME_CERT_BINDING -- TODO

Node.js

  • BP_NODE_VERSION -- Sets the version of node being deployed
  • BP_NODE_RUN_SCRIPTS -- Allows you to run additional npm scripts after npm install (comma seperated)
  • BP_NODE_PROJECT_PATH -- Specifies a subdirectory to build from instead of the project root. Useful for monorepos!
  • BP_LAUNCHPOINT -- Set's the file to run if not a commonly used filename such as index.js or app.js

Java

Each of the frameworks asupported by Paketo have a different set of configuration options. Instead of relisting them all, here are some commonalities

  • BP_DEBUG_ENABLED -- Enables debugging configuration (must be used in conjunction with BPL_DEBUG_ENABLED)
  • BP_JVM_TYPE
  • BPL_DEBUG_ENABLED -- Enables debugging (must be used in conjunction with BP_DEBUG_ENABLED)
  • BPL_DEBUG_PORT -- Which port to allow debugger to attach to. For use with Epinio, this needs to be a port other than 8080 and you would need to proxy the port from kubectl
  • BPL_DEBUG_SUSPEND -- If set to 'y', doesn't start app until debugger is attached
  • BP_EAR_KEY -- AES key to encrypt with at build time
  • BPL_EAR_KEY -- AES key to decypt with at run time

Golang

  • BP_GO_VERSION -- Which version of go to install
  • BP_GO_BUILD_LDFLAGS -- Allows for setting linker flags
  • BP_GO_TARGETS -- Specify multiple targets to build
  • BP_GO_BUILDFLAGS -- Allows for complete customization on build flags
  • BP_KEEP_FILES -- Copies the listed files to the OCI image. Useful for managing static files and other assets

php

Most of the php build pack's are set through the older buildpack.yml configuration as documented here: https://paketo.io/docs/howto/php/

.NET Core

Ruby

Python

Static file hosting

For hosting static files, you can set up either Apache HTTPD or Nginx. This is useful for hosting prebuilt HTML/CSS/JS on one / then another backend on api for example.

Apache HTTPD

Apache gets installed when you have an httpd.conf located at your project's root folder.

Inside of this file, you can use the following variables:

  • SERVER_ROOT
  • PORT
  • APP_ROOT

Nginx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment