Difficulty running cron-only service

2 months ago

Hey Railway team — we’re running a cron-only service built from a custom Dockerfile.

The service still runs a preDeployCommand (pnpm run db:prod:migrate) even though there’s no pre-deploy hook shown in the UI for cron + custom Dockerfile. We can’t disable it in the UI. That pre-deploy step fails because the image is intentionally minimal (no Vite/Vitest/tsconfig).

Is this expected behavior, and is there a supported way to disable or override the pre-deploy command for cron services using Dockerfile builds? We can share deployment IDs if helpful.

Solved

2 Replies

2 months ago

Hey, if you have a railway.toml or railway.json file with a preDeployCommand that your cron service depends on, would it be possible for you to create another railway.toml or railway.json (with a different name) without preDeployCommand being specified? There is an option for in your service's settings to point to another config file.

Please let me know if this is not the case, such as having specified a preDeployCommand in the UI before changing the service to a cron.

1458060282831044600


2 months ago

It was the latter. We did not use a config in code. We duplicated a service which has a pre-deploy command in the service config via the web UI.


Status changed to Solved brody 2 months ago


Loading...