Skip to content

Commit 1215e69

Browse files
committed
feat: add stapeln.toml layer-based container definition\n\nConverted from existing Containerfile to stapeln format.\nIncludes Chainguard base, security hardening, SBOM generation.\n\nCo-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f3c216f commit 1215e69

1 file changed

Lines changed: 88 additions & 0 deletions

File tree

stapeln.toml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# stapeln.toml — Layer-based container build for lcb-website
3+
#
4+
# stapeln builds containers as composable layers (German: "to stack").
5+
# Each layer is independently cacheable, verifiable, and signable.
6+
7+
[metadata]
8+
name = "lcb-website"
9+
version = "0.1.0"
10+
description = "lcb-website container service"
11+
author = "Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>"
12+
license = "PMPL-1.0-or-later"
13+
registry = "ghcr.io/hyperpolymath"
14+
15+
[build]
16+
containerfile = "Containerfile"
17+
context = "."
18+
runtime = "podman"
19+
20+
# ── Layer Definitions ──────────────────────────────────────────
21+
22+
[layers.base]
23+
description = "Chainguard Wolfi minimal base"
24+
from = "cgr.dev/chainguard/wolfi-base:latest"
25+
cache = true
26+
verify = true
27+
28+
[layers.toolchain]
29+
description = "Build tools"
30+
extends = "base"
31+
packages = ["\", "\"]
32+
cache = true
33+
34+
[layers.build]
35+
description = "lcb-website build"
36+
extends = "toolchain"
37+
commands = ["apk add --no-cache \", "curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer", "curl -sL https://wordpress.org/wordpress-6.9.tar.gz | tar xz \"]
38+
39+
[layers.runtime]
40+
description = "Minimal runtime"
41+
from = "cgr.dev/chainguard/wolfi-base:latest"
42+
packages = ["ca-certificates", "curl"]
43+
copy-from = [
44+
{ layer = "build", src = "/app/", dst = "/app/" },
45+
]
46+
entrypoint = ["["/usr/local/lsws/bin/lswsctrl", "start"]"]
47+
user = "wordpress"
48+
expose = [8080]
49+
50+
# ── Security ───────────────────────────────────────────────────
51+
52+
[security]
53+
non-root = true
54+
read-only-root = false
55+
no-new-privileges = true
56+
cap-drop = ["ALL"]
57+
seccomp-profile = "default"
58+
59+
[security.signing]
60+
algorithm = "ML-DSA-87"
61+
provider = "cerro-torre"
62+
63+
[security.sbom]
64+
format = "spdx-json"
65+
output = "sbom.spdx.json"
66+
include-deps = true
67+
68+
# ── Verification ───────────────────────────────────────────────
69+
70+
[verify]
71+
vordr = true
72+
svalinn = true
73+
scan-on-build = true
74+
fail-on = ["critical", "high"]
75+
76+
# ── Targets ────────────────────────────────────────────────────
77+
78+
[targets.development]
79+
layers = ["base", "chainguard-toolchain", "build"]
80+
env = { LOG_LEVEL = "debug" }
81+
82+
[targets.production]
83+
layers = ["runtime"]
84+
env = { LOG_LEVEL = "info" }
85+
86+
[targets.test]
87+
layers = ["base", "chainguard-toolchain", "build"]
88+
env = { LOG_LEVEL = "debug" }

0 commit comments

Comments
 (0)