R
Railway10mo ago
wdytgn

about deployment

hey guys, so i wanna ask, when i deploy my apps for the first time im using this commands for the nixpacks
composer install && php artisan optimize && php artisan storage:link && php artisan migrate --force
composer install && php artisan optimize && php artisan storage:link && php artisan migrate --force
should i change the nixpacks command when i redeploy the apps into the better version like after bugfixing etc? i lost the data when i redeploy the apps with the nixpacks
composer install && php artisan optimize && php artisan storage:link && php artisan migrate:refresh --force
composer install && php artisan optimize && php artisan storage:link && php artisan migrate:refresh --force
and when i redeploy again with this command
composer install && php artisan optimize && php artisan migrate --force
composer install && php artisan optimize && php artisan migrate --force
i lost the photo, like this can i get the link for the picture again? i have no idea and it's frustrating since this is the UAT phase for the apps :((( the app is being developed as my final project for graduation
No description
21 Replies
Percy
Percy10mo ago
Project ID: N/A
wdytgn
wdytgnOP10mo ago
N/A
wdytgn
wdytgnOP10mo ago
i cleary have the post image link but why it doesn't show?
No description
Adam
Adam10mo ago
Railway's default file storage is ephemeral. If you would like your files to persist between deployments, save them to a volume https://docs.railway.app/reference/volumes
should i change the nixpacks command when i redeploy the apps into the better version like after bugfixing etc?
I'm not sure what you mean by this. If you need to change your start command, you can change it. Otherwise, there is no need to change it.
wdytgn
wdytgnOP10mo ago
i already have the volume here
No description
wdytgn
wdytgnOP10mo ago
and also the image path is the same as before, but i dont know why it shows like this
No description
No description
Adam
Adam10mo ago
Looks to me like you're storing the png paths in the volume, but not the images themselves Without more information about your app, I won't be able to help. Are you logging the image finding failures? What's your stack?
wdytgn
wdytgnOP10mo ago
this is the logging
No description
Brody
Brody10mo ago
do you have a volume on your app? (not the database)
wdytgn
wdytgnOP10mo ago
how can i check it?
Brody
Brody10mo ago
look at your apps service, does it have a volume?
wdytgn
wdytgnOP10mo ago
no it doesnt have any volume
No description
Brody
Brody10mo ago
then adam is right, you are only saving data about the file in the database, but arent saving your images anywhere. have a look at this guide please https://docs.railway.app/guides/volumes
wdytgn
wdytgnOP10mo ago
omg okay, i didnt know that before thank you guys
wdytgn
wdytgnOP10mo ago
now i have the volume right?
No description
Brody
Brody10mo ago
yes! now you just need to save the pngs to it, and load them back from it
wdytgn
wdytgnOP10mo ago
how can i do it?
Brody
Brody10mo ago
not a super railway related question, first read the guide (bottom half of it) then maybe check out some online guides on how to read/write files from a certain directory
wdytgn
wdytgnOP10mo ago
okayy brodyy have a nice day
Brody
Brody10mo ago
you too!
Want results from more Discord servers?
Add your server