R
Railway7mo ago
Marko

Docker deployment custom start command

I am trying to start the Docker image with additional parameters like this: ./packages/cli/bin/app.js daemon --api http://myapp.railway.internal The config file seems to be adding a semicolon at the end of the URL "http://myapp.railway.internal"; which is then invalid JSON format, like below:
"data": {
"mode": "remote",
"host": "http://myapp.railway.internal";,
"data": {
"mode": "remote",
"host": "http://myapp.railway.internal";,
} Is there a way to prevent that or a workaround when using custom start commands? When running the Docker image locally / server / k8s it works as expected.
Solution:
with simple code that prints each arg out, i was not able to reproduce this
process.argv.forEach(arg => console.log(arg));
process.argv.forEach(arg => console.log(arg));
this is something the code is adding, further proven by the semicolon appearing outside of the double quotes, if this was railway adding a semicolon to the last argument thats passed in you would see that semicolon appear within the double quotes...
No description
Jump to solution
6 Replies
Percy
Percy7mo ago
Project ID: N/A
Marko
Marko7mo ago
N/A
Brody
Brody7mo ago
interesting, I've never seen this issue before, but try wrapping that command in a shell like so
/bin/sh -c "./packages/cli/bin/app.js daemon --api $RAILWAY_PUBLIC_DOMAIN"
/bin/sh -c "./packages/cli/bin/app.js daemon --api $RAILWAY_PUBLIC_DOMAIN"
also used $RAILWAY_PUBLIC_DOMAIN since that's a variable thats automatically available to the deployment and will either evaluate to the service's railway domain or a custom domain if applicable so there's no need to hardcode your domain in the start command
Marko
Marko7mo ago
seems to be still adding the ; at the end for some reason
Brody
Brody7mo ago
I don't have quite the time to try to reproduce this right now, so... chuck in a string trim instead?
Solution
Brody
Brody7mo ago
with simple code that prints each arg out, i was not able to reproduce this
process.argv.forEach(arg => console.log(arg));
process.argv.forEach(arg => console.log(arg));
this is something the code is adding, further proven by the semicolon appearing outside of the double quotes, if this was railway adding a semicolon to the last argument thats passed in you would see that semicolon appear within the double quotes
No description
Want results from more Discord servers?
Add your server