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

Dynamic environment variables #12534

Closed
RobinSchmid7 opened this issue Feb 7, 2025 · 1 comment
Closed

Dynamic environment variables #12534

RobinSchmid7 opened this issue Feb 7, 2025 · 1 comment

Comments

@RobinSchmid7
Copy link

RobinSchmid7 commented Feb 7, 2025

Description

I would be very useful to be able to set dynamic environment variables in the env_file. The work around seems to be currently to run a bash script that loads these parameters before running docker compose. It would be much cleaner if the env_file could directly load these parameters.

E.g.

services:
  webapp:
    env_file: params.env

where param.env contains

DYN_PARAM=${SOME_OTHER_PARAM}
@ndeloof
Copy link
Contributor

ndeloof commented Feb 7, 2025

This is already how things happen:

$ SOME_OTHER_PARAM=test docker compose config
services:
  webapp:
    environment:
      DYN_PARAM: test

@ndeloof ndeloof closed this as completed Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants