From e01a03b7f235c16964f7c940590fc37b6ebefc7c Mon Sep 17 00:00:00 2001 From: david Date: Wed, 3 Jun 2026 12:09:31 +0200 Subject: [PATCH] buyer/Dockerfile: pre-create archive dir owned by the runtime user for volume seeding The mainnet buyer mounts a named volume at /repo/data/archive, but the container runs as a non-root user, so a fresh root-owned volume left the SQLite response archive + pdf-jobs.db unopenable ("unable to open database file"). Create the dir with the runtime user's ownership before the chown so Docker seeds the empty volume with the right ownership. Co-Authored-By: Claude Opus 4.8 (1M context) --- buyer/Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/buyer/Dockerfile b/buyer/Dockerfile index eb81db6..b28b93e 100644 --- a/buyer/Dockerfile +++ b/buyer/Dockerfile @@ -87,7 +87,12 @@ RUN apk add --no-cache tini # Vite bundle that the Express server will static-serve. COPY --from=builder /repo /repo -RUN chown -R node:node /repo +# Pre-create the archive dir (ARCHIVE_DIR / default ./data/archive) owned by +# `node` BEFORE chown. When a fresh named volume is mounted here, Docker seeds +# the empty volume from this image directory and inherits its node ownership — +# otherwise the volume mounts root-owned and the non-root `node` process can't +# open the SQLite archive / pdf-jobs.db. +RUN mkdir -p /repo/data/archive && chown -R node:node /repo USER node ENV NODE_ENV=production