Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use variables in Supervisor's config files #15

Open
elcapo opened this issue May 23, 2022 · 0 comments
Open

Use variables in Supervisor's config files #15

elcapo opened this issue May 23, 2022 · 0 comments

Comments

@elcapo
Copy link

elcapo commented May 23, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant