R
Railway9mo ago
Aysmith

$PORT error when deploying Django channels with daphne

I am trying to deploy my django channel app on rail way but it keeps on giving me this error : (daphne: error: argument -p/--port: invalid int value: '$PORT') Project id : b3332080-23fb-4662-864f-bb3a48332beb
This is my Dockerfile
this the out put error
Solution:
when using the array syntax for the CMD directive the $PORT environment variable doesn't get escaped and Daphne sees the port flag value as the actual string $PORT. to solve this, don't use the array syntax for CMD...
Jump to solution
5 Replies
Percy
Percy9mo ago
Project ID: b3332080-23fb-4662-864f-bb3a48332beb
Solution
Brody
Brody9mo ago
when using the array syntax for the CMD directive the $PORT environment variable doesn't get escaped and Daphne sees the port flag value as the actual string $PORT. to solve this, don't use the array syntax for CMD
Brody
Brody9mo ago
example CMD daphne app:app --bind 0.0.0.0 --port $PORT also, could you fix the casing in your thread title please, you don't need all caps
Aysmith
Aysmith9mo ago
OKay tryiing this now oh i will It worked! Thank you
Brody
Brody9mo ago
awsome!