Skip to content

fix(docker): ship scripts/ and wget so the cron service can start - #35

Merged
diwenne merged 1 commit into
diwenne:mainfrom
paularro:fix/docker-cron-scripts-wget
Aug 27, 2026
Merged

fix(docker): ship scripts/ and wget so the cron service can start#35
diwenne merged 1 commit into
diwenne:mainfrom
paularro:fix/docker-cron-scripts-wget

Conversation

@paularro

Copy link
Copy Markdown
Contributor

The Dokploy guide tells self-hosters to run scripts/cron.sh as a fourth service from the app image:

  cron:
    image: <same image as web>
    command: ["sh", "scripts/cron.sh"]

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. The container exits immediately.

It fails in the worst possible place, because docs/deploy-dokploy.md already explains why: 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. A self-hoster who follows the guide exactly still ends up with a dead instance two months later.

Change

  • COPY --from=build /app/scripts ./scripts in the runner stage
  • install wget and ca-certificates, cleaning the apt lists in the same layer
  • note the third process in the header comment, next to web and worker

Verification

Running in production on a Hostinger VPS with exactly these two additions, alongside n8n behind the same Traefik. The cron container has been calling the routes on schedule:

[cron] 2026-08-26 14:15:12 attach-next-reel ok {"success":true,"data":{"checked":0,"bound":0,"failedAccounts":0}}
[cron] 2026-08-26 14:20:12 attach-next-reel ok {"success":true,"data":{"checked":0,"bound":0,"failedAccounts":0}}
[cron] 2026-08-26 14:25:13 attach-next-reel ok {"success":true,"data":{"checked":0,"bound":0,"failedAccounts":0}}

And inside that container:

$ ls scripts/ && command -v wget
cron.sh
/usr/bin/wget

wget installs clean on node:20-slim (GNU Wget 1.21.3). Happy to swap the apt layer for a node -e "fetch(...)" call inside cron.sh instead if you would rather keep the image free of extra packages, but that changes the script for people running it outside Docker, so I went with the smaller diff.

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

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

@paularro is attempting to deploy a commit to the diwenne's projects Team on Vercel.

A member of the Team first needs to authorize it.

@diwenne
diwenne merged commit c535931 into diwenne:main Aug 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants