0

I am trying to set multiple profiles for spring boot via docker using an env file like so

.env file

ENV=docker,test

docker-compose

  environment:
    - spring.profiles.active=${ENV}

this seems to cause spring boot to view docker,test as one string if I don't load the env var it works like this

docker-compose

  environment:
    - spring.profiles.active=docker,test

any ideas on how to fix this?

1
  • Can you say a little bit more about what problem you're encountering? An environment variable's value is always a simple string, and the two forms you show should be equivalent; do you have evidence that the application is seeing one differently from the other, or differently from setting a similar environment variable in a non-container setup? Commented Jan 16, 2022 at 18:56

1 Answer 1

1

figure out I can do this env_file: .env

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.