Base solution for your next web application
Open Closed

Docker image *.Host\appsettings.json * all config files - Managing Environment Variables and Configuration Files for ASP Zero-based Solutions outside Docker image #12158


User avatar
0
pliaspzero created

Usage of Angular & ASP:NET CORE - V12:

As part of a client project, we need to deliver our solution in containers. Specifically, we have two containers: one containing the Angular application and the other likely containing the ASP.NET Core component.

Our client has requested that we manage environment variables and configuration files outside of the Docker images to enhance security and flexibility. We would like to know if you have any recommendations or best practices for achieving this with ASP Zero-based solutions. Here are some specific points we are considering:

Creating a Dockerfile without including configuration files. Avoiding hard-coded configuration values in the Dockerfile. Building the Docker image.


4 Answer(s)
  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @pliaspzero,

    You can check this documents.

    https://docs.aspnetzero.com/aspnet-core-angular/latest/Deployment-Angular-Docker https://docs.docker.com/compose/environment-variables/set-environment-variables/

  • User Avatar
    0
    pliaspzero created

    Ok - thanks

    How can I exclude appsettings.json & appsettings.Production.json (MVC API)

    and for angular: assets/appconfig.json assets/appconfig.json assets/appconfig.k8s.json assets/appconfig.production.json - could this also be done in build-with-ng.ps1?

  • User Avatar
    0
    pliaspzero created

    Ok - thanks

    How can I exclude appsettings.json & appsettings.Production.json (MVC API)

    and for angular: assets/appconfig.json assets/appconfig.json assets/appconfig.k8s.json assets/appconfig.production.json - could this also be done in build-with-ng.ps1?

  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @pliaspzero,

    The current docker files are being built in release mode. The command includes just appsettings.Production.json If you don't use it in your project, please remove it.

    I don't understand your second question. But you need to set your environments in docker .yml files