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
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
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
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
These settings are located in the appsettings.json. It uses these settings when you debug or don't use docker
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
You mean to say that in runtime the app container will automatically convert the variable "ConnectionStrings__Default" into "ConnectionStrings:Default" in C# code?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @dzungle,
Yes.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thank you for your support, @ismcagdas
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)