How to override Dockerfile Start CMD/Entrypoint "in exec form"?
I guess this more about me not understanding what "exec form" exactly is (despite reading the docs). Can anyone give an example how would I override in a way that complies with how Railway works:
Let's say my default CMD is:
And the same Dockerfile has:
How do I change it to CMD:
29 Replies
Project ID:
87f6d50b-7bab-488e-b802-02f9edc442e3
87f6d50b-7bab-488e-b802-02f9edc442e3
set the start command to
Thanks @Brody ! Can I also pass env params like
${foo}
?
Or should it be just $foo
in that case?
Also, any reason this seems to be referring env vars from the local environment, rather than production? is there anything special about this override that makes it behave like this?you would need to wrap it in a shell, like so
probably you are pushing your local .env file
Nope, that's not the case. But for some reason that command is looking at
localhost:6379
instead of the production REDIS_URL
.
The other service, where I didn't override the Start Command, is functioning properly.do you have a REDIS_URL service variable?
yes, in both of those services.
It's a dynamic reference to the variable provided from Railway's platform
are you using that variable in code?
yes
can you show me that code?
is that variable being used during build?
care to explain what you mean by that?
hmmm, not too sure how I could be clearer
It is not mentioned anywhere in the
Dockerfile
if that's what you're askingwell I'm trying to figure out if you need to, hence my question
send the dockerfile?
Let me check a hardcoded value of the remote path, and also print the ENV var
I can't do that unfortunately
you can't share the dockerfile?
yeah I think it's a bug in this library I'm using..
I'm curious, why aren't you able to share the dockerfile?
Actually there is absoluately no reason why I can't share it.
maybe I can just remove the labels
By the way, I can't seem to do this:
Is this not supported?
that's definitely supported, do the variables your referencing exist?
Yeah apparently
REDIS_PORT
is empty inside Redis
service, but there's REDIS_PRIVATE_URL
which includes both I guess.wrong variable name
https://docs.railway.app/guides/redis#variables
I just misspelled it here, but it is indeed empty. And changing to
REDIS_PRIVATE_URL
does work.haha nothing is wrong with variable references, it was probably just done wrong is all