Help with setup of laravel cmds on project deployment

definewaterHOBBY

a year ago

Hello everyone so im hosting a laravel rest api but i cant seem to access the terminal and run cmds to seed the database etc, i want to seed the database on every start up

0 Replies

definewaterHOBBY

a year ago

c93cd254-9d7c-42ba-ac53-835e0f60c9cc


definewaterHOBBY

a year ago

1215337985147535400


definewaterHOBBY

a year ago

also now i get this issue for some reason


a year ago

There's no terminal in railway


a year ago

nor SSH connection


definewaterHOBBY

a year ago

ye i thought imma just do it in the build step


a year ago

Yep, add migration command to the start command


definewaterHOBBY

a year ago

but now im getting this issue and i dont seem to quite understand why it is doing it


a year ago

Just be careful with the seeder since it will seed everytime u build


definewaterHOBBY

a year ago

does it not wipe the databse on new deploys?


a year ago

Seems like its Railway related, just try again


a year ago

No


definewaterHOBBY

a year ago

aight imma try


a year ago

Only if ur code does that, but Railway Dbs are persistent


definewaterHOBBY

a year ago

tbh it just to host a quick thing not suppose to be useable


definewaterHOBBY

a year ago

alright i retried now lets see


definewaterHOBBY

a year ago

1215338935979352000


definewaterHOBBY

a year ago

damn


definewaterHOBBY

a year ago

it usually dont take this long with my other servers


definewaterHOBBY

a year ago

it works now but it dont seem to run the migrations


definewaterHOBBY

a year ago

do i need to make a complete new build step for this?


a year ago

run the migrations on the start command


a year ago

eg:
run migration && run start


definewaterHOBBY

a year ago

[build]
builder = "NIXPACKS"

[build]
buildCommand = "php artisan serve"

[deploy]
startCommand = "php artisan migrate && php artisan db:seed --class=TruckSeeder"

definewaterHOBBY

a year ago

i did this


definewaterHOBBY

a year ago

@Medim i think this sis the same


definewaterHOBBY

a year ago

1215340913031651300


definewaterHOBBY

a year ago

i did it in here


a year ago

yes, its the same


definewaterHOBBY

a year ago

aight bet


definewaterHOBBY

a year ago

its some how not working?


definewaterHOBBY

a year ago

1215345953423499300


definewaterHOBBY

a year ago

i served it but it serves to port 8000


definewaterHOBBY

a year ago

what port was it that railway expected it to serve on?


definewaterHOBBY

a year ago

i removed the start functions since i dont need them lets see what that does hehe


a year ago

Do you have a PORT env var?


definewaterHOBBY

a year ago

nawh


definewaterHOBBY

a year ago

do i need one but it worked before?



definewaterHOBBY

a year ago

it works now


a year ago

Then it just wasn't 'there yet'


definewaterHOBBY

a year ago

1215346947938984200


definewaterHOBBY

a year ago

now im getting this issue wth


a year ago

And I guess this issue didn't happen locally


a year ago

?


definewaterHOBBY

a year ago

nah


a year ago

Hmm, I suspect your laravel app is missing some config for prod


a year ago

But I never used Laravel in my entire life


definewaterHOBBY

a year ago

hmm maybe


a year ago

So I don't think I can help u there


Help with setup of laravel cmds on project deployment - Railway Help Station