Application Error, app not listening on $PORT?
i uploaded an app with the railway cli and setted the env variable called PORT, but it's still broken..
38 Replies
what start command have you used?
because it needs the port
like
next start -p $PORT
it's a lavavel application
have you set the port on .env?
just did a small instance
https://laravel-production-f233.up.railway.app/
SERVER_PORT=${PORT}
on the env variables
it must be SERVER_PORT=${PORT}?
ye
the ${PORT} is set by railway itself
i written on the .env vars PORT=${PORT}
its SERVER_PORT
laravel
oh ok
SERVER_PORT=8000 it's ok?
railway defines the port
for the most part
SERVER_PORT=${PORT}
is the config on .env
and thats ithow does it start tho? with a cmd? or in auto?
nixpacks
on deploy logs they show the port
it still doesn't work https://abhorrent-potato-production.up.railway.app/
but you dont define directly with suck as 7078
is the pipeline running?
deploying*
yeah
check deploy logs
and have you set the other env variables?
yeah
wait you mean the one the i use
there are others env vars to make railway service works?
like
i just did copy from the local .env
put
APP_ENV=production
and SERVER_PORT=${PORT}
and was workingwait
i had the app_env on local
maybe that's it
noup
there was any log on build logs?
before the
oh wait
do you have a dockerfile?
i did their default template
mhhh
can u link me the github repo?
nvm i found it
with adding a new service you can spawn a new one
i dont have the same structure tho
adds a database and laravel
if you can run locally with docker
should work fine on railway
i run it locally only using the cmd php artisan serve
not the dockerfile
you should check the build logs
maybe there is a clue there
on the template that they have i dont find the DockerFile
i use the docker-compose that it's not usable on railway...
do u know hot to convert it to a DockerFile?
usually laravel uses sail
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
im not the biggest fan from the framework
if the issue is railway relatedf
you can maybe get more help from their discord server