static

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

README

buildpack-static-confgen

This buildpack builds upon the Paketo nginx Buildpack to automate some of the most common use-cases where the workspace just contains an index.html or public/index.html. It will configure nginx accordingly without any required parameters. It also supports compilation of JavaScript frontend apps when grouped with the web-servers buildpack.

The PORT env variable is required to be set when launching the built container as nginx will use it to configure the listening port.

As this buildpack writes the nginx config which needs to be present in the build phase of the nginx buildpack, it needs to be ordered before that. Due to this ordering it's not possible to require the nginx buildpack. For that we need to use ninech/buildpack-static-require and order it after the nginx/web-servers buildpack.

To test the build locally, checkout this repository and then build it with:

pack build static --path ./integration/testdata/default_app/ \
  --builder paketobuildpacks/builder-jammy-base \
  --buildpack . \
  --buildpack paketo-buildpacks/web-servers \
  --buildpack ghcr.io/ninech/buildpack-static-require

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfigTemplate string

Functions

func Build

func Build(logger scribe.Emitter) packit.BuildFunc

func Detect

func Detect(logger scribe.Emitter) packit.DetectFunc

Types

type BuildPlanMetadata

type BuildPlanMetadata struct {
	Version       string `toml:"version,omitempty"`
	VersionSource string `toml:"version-source,omitempty"`
	Launch        bool   `toml:"launch"`
	WebRoot       string `toml:"web-root,omitempty"`
}

type Configuration added in v0.0.4

type Configuration struct {
	LastModifiedValue string
	ETag              bool
	SetRealIPFrom     string
	nginx.Configuration
}

type DefaultConfigGenerator added in v0.0.4

type DefaultConfigGenerator struct {
	// contains filtered or unexported fields
}

this has been adapted from https://github.com/paketo-buildpacks/nginx/blob/main/default_config_generator.go to add our own customizations to the config

func NewDefaultConfigGenerator added in v0.0.4

func NewDefaultConfigGenerator(logs scribe.Emitter) DefaultConfigGenerator

func (DefaultConfigGenerator) Generate added in v0.0.4

func (g DefaultConfigGenerator) Generate(config Configuration) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL