docker-laravel-queue-worker icon indicating copy to clipboard operation
docker-laravel-queue-worker copied to clipboard

Use variables in Supervisor's config files

Open elcapo opened this issue 3 years ago • 0 comments

From the official page of Supervisor:

Environment variables that are present in the environment at the time that supervisord is started can be used in the configuration file using the Python string expression syntax %(ENV_X)s:

[program:example]
command=/usr/bin/example --loglevel=%(ENV_LOGLEVEL)s

This means that the command line can be directly be written as:

## Suggested
command=php /var/www/app/artisan queue:work %(ENV_QUEUE_CONNECTION)s --queue=%(ENV_QUEUE_NAME)s --memory=%(ENV_MEMORY_LIMIT)s

## Current
command=php /var/www/app/artisan queue:work %%QUEUE_CONNECTION%% --queue=%%QUEUE_NAME%% --memory=%%MEMORY_LIMIT%%

Removing the template "variables" from the current command, would also simplify init.sh.

elcapo avatar May 23 '22 22:05 elcapo