diff --git a/Dockerfile b/Dockerfile index 7c07c594d..9290eedd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -120,6 +120,8 @@ RUN addgroup --system --gid 1001 nodejs && \ # Where the database dumps go (`DB_BACKUP_DIR`). Owned by the app user, so a # fresh named volume mounted here starts with that owner: Docker fills an # empty named volume from the image directory it covers, ownership included. +# Without a mount the directory stays in the container's layer; the app reads +# its mount table, sees that, and keeps no dump here (dump-core.mjs). RUN mkdir -p /var/lib/healthlog/backups && \ chown nextjs:nodejs /var/lib/healthlog/backups && \ chmod 700 /var/lib/healthlog/backups diff --git a/scripts/compose-dr-drill.sh b/scripts/compose-dr-drill.sh index a980ecc26..18538a180 100755 --- a/scripts/compose-dr-drill.sh +++ b/scripts/compose-dr-drill.sh @@ -210,7 +210,10 @@ done fail "without the volume the run read '$RUN', not 'succeeded not_persistent uploaded'" LEFT=$(docker exec "$PROJECT-app" sh -c 'ls -A /var/lib/healthlog/backups') [ -z "$LEFT" ] || fail "a dump was left in the container's layer: $LEFT" -docker logs "$PROJECT-app" 2>&1 | grep -q "is inside the container, not on a mounted volume" || +# Into a file first: `grep -q` stops reading at the match, and with pipefail +# the SIGPIPE that leaves `docker logs` would read as a miss. +docker logs "$PROJECT-app" >"$WORK/no-volume.log" 2>&1 +grep -q "is inside the container, not on a mounted volume" "$WORK/no-volume.log" || fail "the start log does not say the dump directory is inside the container" echo " $RUN, nothing in the container's layer" stack down -v --remove-orphans >/dev/null 2>&1