Skip to content

Use variables in Supervisor's config files #15

Open
@elcapo

Description

@elcapo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions