title: How can I add a volume for the App_Data folder using docker-compose.override.yml?
body: <p>I am experimenting with Visual Studio's <code>docker</code> support and want to add a volume mount for <code>C:\inetpub\wwwroot\App_Data</code>.</p>
  
  <p>My <code>Dockerfile</code> looks like this:</p>
  
  <pre><code>FROM microsoft/aspnet:4.7.1-windowsservercore-1709
  ARG source
  WORKDIR /inetpub/wwwroot
  COPY ${source:-obj/Docker/publish} .
  </code></pre>
  
  <p>My <code>docker-compose.yml</code> file looks like this:</p>
  
  <p>version: '3.4'</p>
  
  <pre><code>services:
    my.app:
      image: ${DOCKER_REGISTRY}myapp
      build:
        context: .\My.App
        dockerfile: Dockerfile
  </code></pre>
  
  <p>Now I've tried just about every variation of specifying <code>volumes</code> in my <code>docker-compose.override.yml</code> file, including:</p>
  
  <pre><code>version: '3.4'
  
  services:
    my.app:
      volumes:
        - "C:\\inetpub\\wwwroot\\App_Data"
      ports:
        - "80"
  networks:
    default:
      external:
        name: nat
  
  services:
    my.app:
      volumes:
        - "C:\\temp\\dockerappdata1":"C:\\inetpub\\wwwroot\\App_Data"
      ports:
        - "80"
  networks:
    default:
      external:
        name: nat
  
  services:
    my.app:
      volumes:
        - type: volume
          source: "app_data"
          target: "C:\\inetpub\\wwwroot\\App_Data"
      ports:
        - "80"
  networks:
    default:
      external:
        name: nat
  volumes:
    app_data:
  </code></pre>
  
  <p>But in all cases, I cannot run the project and it reports either some kind of configuration issue with <code>compose</code> or else an issue when starting the container, with the super-unhelpful message:</p>
  
  <pre><code>encountered an error during Start: failure in a Windows system call: The compute system exited unexpectedly.
  </code></pre>
  
  <p>What is the right syntax?</p>