Configuration

All configuration of StencilBox is via a configuration file called config.yaml. When running StencilBox via Docker, this file is located in the /config directory.

The configuration file can be created and edited using any text editor. The configuration file is in YAML format, which is a human-readable data serialization standard.

The most basic config.yaml file cam be as simple as this:

config.yaml
logLevel: info

Option

Description

Default

Live Reloadable

Documentation

configVersion

The version of the configuration file.

1

No

---

logLevel

The log level to use.

info

Yes

One of debug, info, warn, error.

showFooter

Whether to show the footer in the web UI.

true

No

---

Environment variables

Variable

Description

Default

STENCILBOX_TEMPLATES_DIR

Directory searched for custom templates, before the built-in templates. See Templates.

/config/templates

STENCILBOX_STATE_DIR

Directory where build history is saved (stencilbox-build-history.json), so it survives restarts. This is never inside the output directory, because that is served publicly.

The parent of the output directory, eg /config

STENCILBOX_OUTPUT_DIR

Directory where built sites are written and served from.

/config/output

Stopping StencilBox

On SIGTERM or SIGINT, StencilBox stops accepting new builds and waits up to 25 seconds for builds in progress to finish before exiting. Docker only waits 10 seconds before killing a container by default; to give builds the full time, set stop_grace_period: 30s in Docker Compose, or pass --stop-timeout 30 to docker run.