I am deploying a django web app with Docker on railway and getting app failed to respond. locally the app works fine and has no errors on logs

356 views Asked by At

Here is my build logs

Performing system checks...

2023-10-22 18:47:59.212964: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered

2023-10-22 18:47:59.213026: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered

2023-10-22 18:47:59.213120: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered

System check identified some issues:

WARNINGS:

?: (staticfiles.W004) The directory '/usr/src/app/static' in the STATICFILES_DIRS setting does not exist.

System check identified 1 issue (0 silenced).

October 22, 2023 - 18:48:02

Django version 4.1.7, using settings 'apitutorial.settings'

Starting development server at http://0.0.0.0:8000/

Quit the server with CONTROL-C.

They look like the ones I get on my local machine, my fear then is there could be a networking issue, as a result the domain that I am clicking doesn't point to my web app. Its a django rest app.

The page loads with app failed to respond.

1

There are 1 answers

1
Derby T matoma On

Read documentation for railway. So I found a work around it, and it was $PORT issue, the documentation does have a little information. Here is what I did. in my entry.sh

python manage.py migrate --no-input
python manage.py collectstatic --no-input

DJANGO_SUPERUSER_PASSWORD=$SUPER_USER_PASSWORD python manage.py createsuperuser --username $SUPER_USER_NAME --email $SUPER_USER_EMAIL --noinput

gunicorn investment_manager.wsgi:application --bind 0.0.0.0:$PORT
**take not of --bind 0.0.0.0:$PORT instead of --bind 0.0.0.0:8000**

Other things I did include using nginx for reverse proxy, I am not sure if that worked, cause my browser isn't showing nginx is handling the requests or I am not checking properly. Eitherways this was lowkey a trial and error thingy. I have another deployment to make, and I will not use nginx to see if that changes anything.