Feature Request: Ability to Change Docker Command #1689
Replies: 7 comments 11 replies
-
I think it's now available, if so, please close this conversation |
Beta Was this translation helpful? Give feedback.
-
why do you want to change it? can you please give me an example use-case? |
Beta Was this translation helpful? Give feedback.
-
same here, workers and web on same image, so I need to use different CMD |
Beta Was this translation helpful? Give feedback.
-
One other workaround I've found is using environment variables to change the CMD dynamically. For my case (a rust app with a server and a worker), I have the CMD set to:
For the worker, I can set the BINARY_NAME environment variable to worker |
Beta Was this translation helpful? Give feedback.
-
An example of such an application would be a rails application. You start the server with I have never seen a custom Dockerfile for sidekiq. My company uses EasyPanel which has the option to change the docker command: On my personal projects I have an app which can work either as a webcrawler and/or a server (I know that it should've been seperate but oh well). I can specify via an argument whether it should works with the server or not. |
Beta Was this translation helpful? Give feedback.
-
Any solution for this, yet? In my case, I'm having trouble trying to make MongoDB work as a shard config server. It seems I have to explicitly add the |
Beta Was this translation helpful? Give feedback.
-
Afaik, the simplest way to do this for custom containers is to setup a custom entrypoint which is a bash script and set the default variable as the default execute command. Something like this:
#!/bin/bash
/bin/bash -c "${DEPLOY_COMMAND:-mix phx.server} End of ENTRYPOINT [ "./coolify-fix.sh" ] I was then able to run the following commands: $ docker build . -t my_app
$ docker run -e DEPLOY_COMMAND="echo 'hello there'" my_app
hello there Of course, this is a workaround and coolify REALLY needs the ability to change the command. This works on an app I made, sure, but won't work if I were to pull an image of another app of which I'm not the maintainer of. |
Beta Was this translation helpful? Give feedback.
-
I would love to be able to set a custom command when deploying a docker image
Current workaround: Create a docker-compose deployment with one service with the custom command
Beta Was this translation helpful? Give feedback.
All reactions