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) <noreply@anthropic.com>
This commit is contained in:
david
2026-06-03 12:09:31 +02:00
parent cf77811331
commit e01a03b7f2

View File

@@ -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