Laravel, add cache clearing and migration
jorgt
PROOP

a year ago

Hi,

I'm trying to set up laravel. while the deployment with the default nixpack works perfectly, I cannot seem to find the right place to clear and optimize caches and run any migration where applicable. I have followed these steps:

https://docs.railway.com/guides/laravel

in all place I try, php is not available. I have added some simple php artisan commands to the start step, deploy step and predeploy step. What's the correct way to do this?

Here's some of the output. While using the .sh file as described above in the build step. I have tried these as a script and by themselves:

[11/12] RUN  chmod +x ./build-app.sh && sh ./build-app.sh 
process "/bin/bash -ol pipefail -c chmod +x ./build-app.sh && sh ./build-app.sh" did not complete successfully: exit code: 1
 

Dockerfile:25

-------------------

23 |     # build phase

24 |     COPY . /app/.

25 | >>> RUN  chmod +x ./build-app.sh && sh ./build-app.sh

26 |

27 |

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c chmod +x ./build-app.sh && sh ./build-app.sh" did not complete successfully: exit code: 1

Error: Docker build failed

Here is the same command in the deploy stage.

Starting Container

 

   INFO  Nothing to migrate.  

 

/bin/bash: line 1:  php: command not found

Stopping Container
Solved

3 Replies

chandrika
EMPLOYEE

a year ago

Hey, have you checked our guide on deploying a Laravel app https://docs.railway.com/guides/laravel


Status changed to Awaiting User Response Railway 12 months ago


chandrika

Hey, have you checked our guide on deploying a Laravel app https://docs.railway.com/guides/laravel

jorgt
PROOP

a year ago

Hello, yes I have actually pasted that link in my question to show you that I did my due diligence. It's possible I overlooked something but I can't see what.


Status changed to Awaiting Railway Response Railway 12 months ago


a year ago

Perhaps you would want to start from the template then?

https://railway.com/new/template/fWEWWf


Status changed to Awaiting User Response Railway 11 months ago


Railway
BOT

7 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 7 months ago


Loading...