Hello Support Team,
I am using .NET Core and Angular project template. I want to set ConnectionString value in Dockerfile. Could you please tell me how to do this? Thank you very much.
Best Regards,
6 Answer(s)
-
0
Hi @dzungle,
You can do it like this https://github.com/aspnetzero/aspnet-zero-core/blob/3714b6630d7a0e89521a8d9e2649ba3c19ee750c/aspnet-core/docker/mvc/docker-compose-host.yml#L12
-
0
Hello @ismcagdas,
Thank you for your quik support. I'm newbie to dockerization. Please, help me sort out some more questions.
Do I need to declare "ConnectionStrings__Default" & "Abp__RedisCache__ConnectionString" (or any other environment variables) in ASP.NET Core code? If yes, where to declare them? And how to get the values of these environment variables?
Thank you in advance
-
0
These settings are located in the appsettings.json. It uses these settings when you debug or don't use docker
-
0
You mean to say that in runtime the app container will automatically convert the variable "ConnectionStrings__Default" into "ConnectionStrings:Default" in C# code?
-
0
Hi @dzungle,
Yes.
-
0
Thank you for your support, @ismcagdas