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
Percy2y ago
Project ID: caec4df4-d593-4edd-a40b-bd8b2114a0f7
Stoopid
StoopidOP2y ago
Project ID: caec4df4-d593-4edd-a40b-bd8b2114a0f7
Brody
Brody2y 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
StoopidOP2y 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
Brody2y ago
sounds overly complicated
Stoopid
StoopidOP2y ago
Is there a way to poll the status of the deployment when using --detach?
Brody
Brody2y ago
you can use the api for that, poll the deployment query, it will return a status field
Brody
Brody2y ago
Stoopid
StoopidOP2y ago
awesome, thank you @Brody
Want results from more Discord servers?
Add your server