title: Docker bind mount to environment variable (in ASP.NET Core)
body: <p>I have two paths. One to take templates from and one to generate documents in.
  Deploying this on Docker works fine (the App starts, works and gives no warnings), bind mount creates these 2 directories on my local machine, but doesn't seem to use them, or even create them? on the container.</p>
  
  <p>Here is what I tried:</p>
  
  <p>1) Specified paths in AppSettings.json (this is my configuration without Docker, it will be overridden below in docker-compose file)</p>
  
  <pre><code>  "RootDirectoryForDocuments": {
      "DocumentsRoot": "TestDocumentsDir",
      "TemplatesRoot": "TestTemplatesDir"
    }
  </code></pre>
  
  <p>2) Created Docker Compose File. Here first I'm giving the paths as environment variables and then trying to make the container use them in volumes section:</p>
  
  <pre><code>version: "3.7"
  services:
      hraapi: 
          build: ../Hra.Api
          environment:
              - ASPNETCORE_ENVIRONMENT=Development
              - ENV_RootDirectoryForDocuments_DocumentsRoot="/app/GeneratedDocs"
              - ENV_RootDirectoryForDocuments_TemplatesRoot="/app/Templates"
  
          image: user/hra.api:v1.0
          container_name: hra.api
          ports:
              - "5000:80"
          depends_on:
              - hradb
          volumes:
              - C:/Users/User/Desktop/GeneratedDocs:/app/GeneratedDocs
              - C:/Users/User/Desktop/Templates:/app/Templates
  </code></pre>
  
  <p>When I run this DockerCompose it automatically creates these 2 Folders on my Desktop. However, I was hoping it would create and use them in the Container as well.
  I tried a lot to find how ASP.NET Core containers are structured, in order to use an already existing path there but without success.</p>