gecche / laravel-multidomain

A Laravel extension for using a laravel application on a multi domain setting
MIT License
838 stars 105 forks source link

Domain parameter not defined with supervisor #21

Closed nechin closed 4 years ago

nechin commented 4 years ago

Hi.

I use a Docker with worker container and supervisor in it. In worker config file I defined the command=/usr/local/bin/php /var/www/html/artisan queue:work --sleep=3 --tries=3 --domain=domain.com. The supervisor defined as ENTRYPOINT in Dockerfile (with worker config). So in detectDomain method the argv parameter don't have the domain key. Therefore, the scheduler always uses the .env config file.

Any ideas?

Thanks.

gecche commented 4 years ago

I have used Docker but I'm not very expert... anyway... Do you mean you use supervisor together with the Laravel schedule:run command? In this case, you should add the domain option to the schedule:run command too and so run a scheduler for each domain.

But maybe I totally did not understand your problem.

Cheers

Giacomo

nechin commented 4 years ago

I can use domain option only in the worker file (see below). Not in schedule:run command (it used in dockerfile like RUN crontab /etc/crontabs/laravel.cron). In any case, keep this option in mind. It is not compatible with your extension.

Thanks.

MrCanan commented 4 months ago

Hi, But, is the --option in scheduler:run works outside/without docker for you? Because it seems not working in my case ? Or I missed something ^^ Because the artisan command with --domain option works in terminal, same with scheduler:run command, but not of in cron (crontab -e) Best regards

gecche commented 4 months ago

Hi,

I'm not sure I understood your question.... however I use my package together with crons and WITHOUT docker in a lot of projects. The trick is that you have to launch one cron process for each domain, for example this is a crontab line:

`

Cheers

Giacomo

MrCanan commented 4 months ago

Hi, Thank you for your answer, I do the same, My artisan command works alone, but nothing in cron, So I have perhaps an issue with new scheduler system of Laravel 11