From 6f67091abdfc083d0e2c5fbb676f427914cb90ff Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 27 Aug 2026 09:42:39 +0200 Subject: [PATCH] fix(docker): ship scripts/ and wget so the cron service can start docs/deploy-dokploy.md tells self-hosters to run scripts/cron.sh as a fourth service from the app image, but that service cannot start as written: the runner stage never copies scripts/, and node:20-slim does not include wget, which is what cron.sh calls the routes with. It fails quietly in the worst place. One of the three jobs is refresh-tokens, so without it the Instagram token expires after 60 days and every automation stops with no error anywhere: comments keep arriving and nothing answers them. Copy scripts/ into the runner stage and install wget, and note the third process in the header comment alongside web and worker. --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index 7ad9fa3d..29656f59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,9 @@ # not a bundled output — needs the generated Prisma client, the # full source tree under lib/ and worker/, and tsconfig.json for # the `@/*` path alias tsx resolves at runtime) +# - cron: `sh scripts/cron.sh` → the scheduler for /api/cron, which nothing +# runs off Vercel (see docs/deploy-dokploy.md). It needs scripts/ +# in the image and wget on PATH; node:20-slim ships neither. # # next.config.ts does not set `output: "standalone"`, so `next start` already # requires the full node_modules tree at runtime — there is no slimmer @@ -30,6 +33,12 @@ FROM node:20-slim AS runner WORKDIR /app ENV NODE_ENV=production +# scripts/cron.sh calls the /api/cron routes with wget, which node:20-slim does +# not include. +RUN apt-get update \ + && apt-get install -y --no-install-recommends wget ca-certificates \ + && rm -rf /var/lib/apt/lists/* + COPY --from=build /app/node_modules ./node_modules COPY --from=build /app/.next ./.next COPY --from=build /app/app/generated ./app/generated @@ -37,6 +46,7 @@ COPY --from=build /app/public ./public COPY --from=build /app/lib ./lib COPY --from=build /app/worker ./worker COPY --from=build /app/prisma ./prisma +COPY --from=build /app/scripts ./scripts COPY --from=build /app/prisma.config.ts ./prisma.config.ts COPY --from=build /app/next.config.ts ./next.config.ts COPY --from=build /app/tsconfig.json ./tsconfig.json