Skip to content

Add support for VAR_FILE to enable use of secrets #488

@JCPvanHooren

Description

@JCPvanHooren

Description of your request
Enable setting environment variables from files instead of strings to enable the use of secrets.

Describe the solution you'd like
Support the VAR_FILE convention.

Describe alternatives you've considered
I've tried to run my docker compose with

entrypoint: >
      sh -c '
      export DB_PASSWORD="$(cat /run/secrets/db_pwd)";
      exec docker-php-entrypoint apache2-foreground
      '

command: >
      sh -c '
        export DB_PASSWORD="$(cat /run/secrets/db_pwd)";
        exec "$@"
      '

command:
      - sh
      - -c
      - |
        export DB_PASSWORD="$(cat /run/secrets/db_pwd)"
        exec apache2-foreground

Additional context
Apologies if this is due to my limited knowledge of Docker. If there's already a way to use secrets, I'm happy to take any recommendations and close the request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestimprovementImprove an existing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions