From f68ddad6f394d8cf5b88f63b7e359f5d479ac0b5 Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Sun, 6 Sep 2026 13:46:55 +0530 Subject: [PATCH] =?UTF-8?q?Fix=20seed=20script=20unreadable=20in=20image:?= =?UTF-8?q?=20COPY=20--chmod=20applied=200644=20to=20the=20auto-created=20?= =?UTF-8?q?/app/scripts=20dir=20(unsearchable=20for=20the=20node=20user=20?= =?UTF-8?q?=E2=86=92=20MODULE=5FNOT=5FFOUND).=20Seed=20now=20lives=20at=20?= =?UTF-8?q?/app/pb-seed.mjs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 +-- entrypoint.sh | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 07ab000..3880c48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,8 +60,7 @@ RUN --mount=type=cache,target=/root/.npm \ npm ci --omit=dev --no-audit --no-fund COPY --from=builder --chown=root:root /app/dist ./dist -COPY --chmod=0644 server.mjs entrypoint.sh ./ -COPY --chmod=0644 scripts/pb-seed.mjs ./scripts/pb-seed.mjs +COPY --chmod=0644 server.mjs entrypoint.sh scripts/pb-seed.mjs ./ # Run as the unprivileged `node` user shipped with the base image. USER node diff --git a/entrypoint.sh b/entrypoint.sh index 8ef8956..a5fc7b9 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -25,9 +25,9 @@ PB_PID=$! # when records already exist or no superuser env is provided) ( sleep 2 - if [ ! -f scripts/pb-seed.mjs ]; then - echo "[entrypoint] WARNING: scripts/pb-seed.mjs missing from image — the image was built from a stale checkout; rebuild it" - elif node scripts/pb-seed.mjs; then + if [ ! -f pb-seed.mjs ]; then + echo "[entrypoint] WARNING: pb-seed.mjs missing from image — the image was built from a stale checkout; rebuild it" + elif node pb-seed.mjs; then echo "[entrypoint] pocketbase seed complete" else echo "[entrypoint] pocketbase seed skipped/failed — site falls back to bundled defaults"