Skip to content

Polish repository for open-source and Docker Hub - #26

Closed
mainman94 wants to merge 42 commits into
naskio:mainfrom
mainman94:chore/oss-polish
Closed

Polish repository for open-source and Docker Hub#26
mainman94 wants to merge 42 commits into
naskio:mainfrom
mainman94:chore/oss-polish

Conversation

@mainman94

Copy link
Copy Markdown

What

Turns the repo into a properly presented open-source project and makes the published images self-describing.

Images

  • OCI labels on both variants (title, description, version, revision, created, url, source, documentation, licenses, vendor, base.name), fed by new VCS_REF / BUILD_DATE build args.
  • Publish workflow passes the commit SHA and build timestamp, and now attaches an SBOM and max-mode provenance attestation to pushed images.
  • Debian variant drops /var/lib/apt/lists/* — it was left in the layer.

CI (new ci.yml, runs on PRs and pushes to main)

  • hadolint (with a .hadolint.yaml documenting why package versions float) and shellcheck.
  • Asserts the two docker-entrypoint.sh files stay byte-identical — they are today, and nothing enforced it.
  • Builds and smoke-tests both variants on amd64.

Docs

  • Root README rewritten. It is pushed to Docker Hub as the repository description, so: badges, tag table, env var reference, and absolute links (relative ones do not resolve there).
  • Variant READMEs get build-arg tables and UID/GID guidance.
  • New CONTRIBUTING, SECURITY, CODE_OF_CONDUCT, issue templates (with links out to strapi/strapi for upstream bugs) and a PR template.
  • LICENSE records the fork's copyright alongside the original.

Examples — both still pointed at the upstream naskio/strapi image with Compose v1 syntax and a strapi-v4 service name. Updated to dockerha08/strapi:alpine-latest; the Postgres example now waits on a pg_isready healthcheck, no longer publishes 5432 to the host, and reads its password from the environment.

Verification

Both variants built locally at Strapi 5.52.3 and passed ./smoke-test.sh; labels verified with docker inspect. hadolint and shellcheck pass against the committed config.

🤖 Generated with Claude Code

renovate Bot and others added 30 commits August 31, 2026 17:52
…n-7.x

Update docker/build-push-action action to v7
…n-4.x

Update docker/setup-qemu-action action to v4
…ion-4.x

Update docker/setup-buildx-action action to v4
…-commit-action-7.x

Update stefanzweifel/git-auto-commit-action action to v7
…escription-5.x

Update peter-evans/dockerhub-description action to v5
- strapi-debian/Dockerfile: resolve leftover merge-conflict markers from a
  stash pop that left the file uncommitted-broken.
- Both Dockerfiles: move ENV STRAPI_VERSION after the first FROM (ENV before
  any FROM makes buildx fail with "no build stage in current context"), and
  re-declare STRAPI_VERSION as ARG in each stage that needs it.
- Both Dockerfiles: pin NODE_VERSION default to 24 — better-sqlite3@12.8.0
  doesn't support Node 26 yet.
- Both docker-entrypoint.sh: run Strapi via the local project binary
  (./node_modules/.bin/strapi) instead of the globally-installed CLI. The
  global install's own node_modules tree doesn't contain the project's DB
  driver (pg, mysql, ...), so any non-sqlite database crash-loops the
  container with "Cannot find module 'pg'".
- publish-docker-images.yml: pull the Docker Hub token from OpenBao via
  GitHub Actions OIDC (hashicorp/vault-action) instead of static repo
  secrets, bump actions/checkout to v4, fix the deprecated
  ::set-output syntax, and align alpine tags to alpine-<version> to match
  what's already published under dockerha08/strapi.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yUP41cmFcfAKRc1qxCod4
Fix broken Docker builds, bootstrap loop, and DB driver resolution
…-4.x

Update hashicorp/vault-action action to v4
- auto-check-new-releases.yml: fetch PAT via GitHub Actions OIDC
  (homelab/data/prod/github, key PAT) using the same gha-docker-strapi
  role as the publish workflow, instead of a static secrets.PAT repo
  secret. Also bumps checkout to v4 and fixes the deprecated
  ::set-output syntax.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yUP41cmFcfAKRc1qxCod4
Pull release-check PAT from OpenBao instead of a repo secret
Both Dockerfiles' builder stage ran `npm install -g yarn @strapi/strapi`,
but node:24-alpine (and the debian slim variant) already ships a yarn
binary/shim at /usr/local/bin/yarn via corepack. npm's global install
refuses to overwrite it (EEXIST), which broke multi-arch builds —
reproduced on linux/arm64. --force lets npm replace the shim with a real
yarn install, which docker-entrypoint.sh depends on for `yarn install --prod`.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yUP41cmFcfAKRc1qxCod4
Fix npm install -g yarn conflict with node:24-alpine's bundled shim
Track node:24-alpine and node:24-trixie-slim digests in release-versions/,
refreshed by the same daily check as the strapi version. Since
publish-docker-images.yml already triggers on any release-versions/* push,
a node base image update now cascades into a new build/push exactly like
a strapi release does.

Closes #4

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yUP41cmFcfAKRc1qxCod4
vault.hauptmann.dev sits behind Cloudflare Bot Fight Mode, which challenges
GitHub Actions runners and breaks the OIDC vault-action fetch in both
workflows. Falls back to plain repo secrets (PAT, DOCKER_TOKEN) instead of
carving a WAF exception.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yUP41cmFcfAKRc1qxCod4
Rebuild images when node base image updates, not just strapi version
dockerha08/strapi already has debian-slim-<version>/debian-slim-latest
tags (pushed manually), not <version>/latest. Match the workflow to that.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yUP41cmFcfAKRc1qxCod4
Build pipeline was slow: alpine and debian ran sequentially in one job
(each doing a build-for-smoke-test then a full multi-arch build-and-push,
so effectively 4 builds back to back), with no cache reuse between any of
them.

- Matrix over [debian, alpine] so both variants build/push in parallel
  jobs instead of one after another.
- cache-from/cache-to (GHA backend, one scope per variant) so the
  smoke-test build and the push build share layers, and repeated workflow
  runs reuse the apk/npm-heavy layers instead of rebuilding from scratch.
- Docker Hub description + GitHub release moved to a separate `finalize`
  job that runs once after both matrix legs, instead of duplicating them
  per variant.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yUP41cmFcfAKRc1qxCod4
Build each image for amd64 only, load it locally, boot with sqlite and
watch for a clean start vs. the failure signatures this repo has actually
hit (EACCES, missing DB driver module, npm errors). Only push the real
multi-arch build if that passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yUP41cmFcfAKRc1qxCod4
Two real bugs the new smoke test caught on first run:

- create-strapi-app writes DATABASE_FILENAME= (empty) into .env for every
  DB client, including sqlite. Strapi's env() helper treats an explicitly
  empty var as set, so the sqlite default (.tmp/data.db) never applies and
  better-sqlite3 fails with a bare "unable to open database file". Strip
  the empty line.

- Recent npm blocks install/postinstall scripts by default. This silently
  skips better-sqlite3's native binding fetch (and esbuild/@swc/core, used
  for TS compilation regardless of DB client) — not sqlite-specific, would
  likely also break fresh postgres bootstraps. Approve and rebuild once
  right after scaffolding.

Also added --skip-cloud --non-interactive to create-strapi-app: without
them it prompts an interactive Strapi Cloud login and crashes with no TTY
(readline closed).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yUP41cmFcfAKRc1qxCod4
Smoke-test images pre-push, fix sqlite bootstrap, speed up pipeline
Top-level README was still the unmodified naskio upstream copy (v4,
node:18, naskio/strapi image, mongo as a supported DB client — dropped in
v5). Per-image READMEs claimed Node 26 (default is 24) and a pinned
appuser UID 1000 (not pinned; debian variant runs as root, not appuser,
at all).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yUP41cmFcfAKRc1qxCod4
No way to force a rebuild/push without touching release-versions/*.
workflow_dispatch lets us fire it on demand (e.g. to pick up entrypoint or
Dockerfile fixes that don't bump the strapi version).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012yUP41cmFcfAKRc1qxCod4
Update READMEs to match this fork's actual state
Allow manually triggering the publish workflow
Add OCI image labels to both variants, fed by new VCS_REF and BUILD_DATE
build args that the publish workflow fills from the commit SHA and build
time. Published images now also carry an SBOM and max-mode provenance
attestation.

Add the OSS files the repo was missing: CONTRIBUTING, SECURITY,
CODE_OF_CONDUCT, issue and pull request templates, and a CI workflow that
lints (hadolint, shellcheck), asserts the two entrypoints stay identical,
and builds plus smoke-tests both variants on every pull request.

Rewrite the root README, which doubles as the Docker Hub description: tag
table, environment variable reference, badges, and absolute links, since
relative ones do not resolve on Docker Hub.

Fix the examples, which still referenced the upstream naskio/strapi image
and Compose v1 syntax. The Postgres example now waits on a database
healthcheck, keeps Postgres off the host network, and takes its password
from the environment.

Also drop apt lists from the Debian layer and record the fork's copyright
alongside the original in LICENSE.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mainman94

Copy link
Copy Markdown
Author

Opened by mistake against upstream — this belongs in the fork. Sorry for the noise.

@mainman94 mainman94 closed this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants