I'm trying to modify environment variables of my application via docker-compose.yml file.
My appsettings.Development.json looks like below:
{
"ConnectionStrings": {
"DefaultConnection": "Server=127.0.0.1,1433;Database=app;User Id=sa;Password=P@ssw0rd"
},
"EventBusSettings": {
"HostAddress": "amqp://guest:guest@localhost:5672"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Roles": [
"Member",
"Admin"
]
}
Using docker-compose.yml I modify ConnectionStrings:DefaultConnection and EventBusSettings:HostAddress like in example below:
# ...
app:
image: app
container_name: app
build:
context: .
dockerfile: Services/App/Dockerfile
ports:
- 5000:5000
depends_on:
- db
- rabbitmq
- portainer
environment:
- ConnectionStrings:DefaultConnection=Server=db,1433;Database=app;User Id=sa;Password=P@ssw0rd
- EventBusSettings:HostAddress=amqp://guest:guest@rabbitmq:5672
# ...
How can I modify first element of Roles in appsettings.Development.json via docker-compose.yml?