R
Railway17mo ago
Stoopid

Init containers/side-car

Hi, I am moving my infrastructure from a cloud provider to Railway. I have a PHP Lumen API that poses 2 issues: 1. I need to run database migrations before deploying. Is there a feature such as init containers in K8s? I know I could also probably run the migrations in my Dockerfile by referencing the Database credentials. 2. Laravel/lumen also needs a worker process that runs in the background, how can I achieve that?
9 Replies
Percy
Percy17mo ago
Project ID: caec4df4-d593-4edd-a40b-bd8b2114a0f7
Stoopid
Stoopid17mo ago
Project ID: caec4df4-d593-4edd-a40b-bd8b2114a0f7
Brody
Brody17mo ago
I know I could also probably run the migrations in my Dockerfile by referencing the Database credentials
thats probably your best bet.
Laravel/lumen also needs a worker process that runs in the background, how can I achieve that?
maybe something like supervisord?
Stoopid
Stoopid17mo ago
My plan is to have this service be deployed from a CI/CD pipeline, could I maybe create another service and after deploying the main app switch to the worker railway service and deploy with another dockerfile that starts the queue?
Brody
Brody17mo ago
sounds overly complicated
Stoopid
Stoopid17mo ago
Is there a way to poll the status of the deployment when using --detach?
Brody
Brody17mo ago
you can use the api for that, poll the deployment query, it will return a status field
Brody
Brody17mo ago
Stoopid
Stoopid17mo ago
awesome, thank you @Brody
Want results from more Discord servers?
Add your server