Application Run Command cannot run chained startup scripts
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 37.4k
- Forks
- 3k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 73
Description
What problem will this feature address?
I deploy Applications from images I do not control. I need startup steps (migrations) before my main process starts. I open Advanced, Run Command, and I paste a chained script:
npx prisma migrate deploy && node server.js
or:
php artisan migrate --force && apache2-foreground
Dokploy splits my string on spaces in mechanizeDockerContainer (packages/server/src/utils/builders/index.ts). Docker receives && as a literal argument. My container fails. Single commands work for me. Anything chained does not. The Args list below the field cannot express sequencing either.
Describe the solution you'd like
I propose a mode switch on the Run card. I keep Single as the default and I leave its behavior exactly as today: one command plus Args. I add Custom shell as opt-in: I pick sh or bash and I paste my startup script. Dokploy then sets my container Command to [shell, -c, script] and skips Args in that mode. I need my image to include the shell I pick.
Describe alternatives you've considered
- Baking my steps into the image: impossible when I do not own the image.
- Running one wrapper process per app outside Dokploy: defeats the purpose of the Run Command field for me.
- Pre/post deploy hooks (#110): useful, but they run on the host around deploy, not as my container command at startup and restart.
Additional context
Related: #110 (pre/post hooks), #1295 (&& rejected), #1040 (compose command limits). I tested locally: my service inspects as [sh, -c, <script>] and my script output leads the container logs.
Will you send a PR to implement it?
Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/server/src/utils/builders/index.ts, then trace the Advanced Run card that supplies the command and Args values. Implement the requested Single and Custom shell behavior without changing the default mode; done means shell scripts execute as [shell, -c, script] while Single still uses the existing command and Args handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell, typescript
- Domain
- backend, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100