Multiple commands on start command won't work
I have a Django application for which I have a a Dockerfile, it works fine, but for a
staging
environment I wish to override the start command.
I created the following json to chain multiple commands including the sleep 3
to wait for the private DNS, but it only executes the first command, I already did a ton of tests, if I remove the sleep
in the deployment logs I get to see only the migrate
command output but the server doesn't execute the gunicorn
. If I remove everything and only leave the gunicorn
it works normally.
Solution:Jump to solution
when using a Dockerfile the start command you set either in the service settings or in the railway.json file is treated as an ENTRYPOINT meaning there is no shell running,
&&
does not work without a shell, you would need to wrap your start command in a shell (thats what that syntax of CMD does)
...5 Replies
Project ID:
0583e1e9-1aa9-46ae-991c-5f8536d626c7
0583e1e9-1aa9-46ae-991c-5f8536d626c7
Solution
when using a Dockerfile the start command you set either in the service settings or in the railway.json file is treated as an ENTRYPOINT meaning there is no shell running,
&&
does not work without a shell, you would need to wrap your start command in a shell (thats what that syntax of CMD does)
Ahhhh TIL π thanks so much! It works.
no problem!