fix(backup): install pg_dump (postgresql16-client) in app + worker images
The DR backup engine spawns `pg_dump` (backup.service.ts), but neither runner image installed a postgres client — so producing a bundle fails in prod with ENOENT (only worked in dev, where the host has pg_dump). Surfaced by testing the feature on the live prod container. Add `postgresql16-client` (pg_dump 16.x, matched to the postgres:16 server) to the runner stage of Dockerfile (crm-app: on-demand export + "back up now") and Dockerfile.worker (scheduled backup-push cron). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,9 @@ RUN apk add --no-cache --virtual .merge-deps rsync \
|
|||||||
&& rsync -a --ignore-existing /opt/prod-node-modules/ ./node_modules/ \
|
&& rsync -a --ignore-existing /opt/prod-node-modules/ ./node_modules/ \
|
||||||
&& rm -rf /opt/prod-node-modules \
|
&& rm -rf /opt/prod-node-modules \
|
||||||
&& apk del .merge-deps
|
&& apk del .merge-deps
|
||||||
|
# pg_dump for the backup/DR bundle engine (src/lib/services/backup.service.ts
|
||||||
|
# spawns `pg_dump`). Version pinned to match the postgres:16 server.
|
||||||
|
RUN apk add --no-cache postgresql16-client
|
||||||
USER nextjs
|
USER nextjs
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ FROM node:20-alpine AS runner
|
|||||||
RUN corepack enable && corepack prepare pnpm@10.33.2 --activate
|
RUN corepack enable && corepack prepare pnpm@10.33.2 --activate
|
||||||
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 worker
|
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 worker
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
# pg_dump for the scheduled backup-push cron (maintenance worker runs
|
||||||
|
# runScheduledBackupPush → pg_dump). Pinned to match the postgres:16 server.
|
||||||
|
RUN apk add --no-cache postgresql16-client
|
||||||
RUN chown -R worker:nodejs /app
|
RUN chown -R worker:nodejs /app
|
||||||
USER worker
|
USER worker
|
||||||
COPY --chown=worker:nodejs package.json pnpm-lock.yaml ./
|
COPY --chown=worker:nodejs package.json pnpm-lock.yaml ./
|
||||||
|
|||||||
Reference in New Issue
Block a user