title: Docker Aspnet core Setting physical directory path
body: <p>I am trying to run the aspnet core application In docker container. I am having issues with physical file provider.</p>
  
  <p>In my application startup.cs I am using following code to for a physical file provider and map with alias</p>
  
  <pre><code>  app.UseFileServer(new FileServerOptions
          {
              FileProvider = new PhysicalFileProvider("G:\\Work\\LMS\\lms-data"),
              RequestPath = new PathString("/lms-data"),
              EnableDirectoryBrowsing = false
          });
  </code></pre>
  
  <p>Now My docker file is </p>
  
  <pre><code>FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
  ENV ASPNETCORE_ENVIRONMENT=Development
  ENV DOTNET_USE_POLLING_FILE_WATCHER=1
  WORKDIR /app
  EXPOSE 5000
  EXPOSE 5001
  
  COPY ["SharedKernal/SharedKernal.csproj", "SharedKernal/"]
  COPY ["LMS.Entities/LMS.Entities.csproj", "LMS.Entities/"]
  COPY ["LMS.Core/LMS.Core.csproj", "LMS.Core/"]
  COPY ["LMS.Infrastructure/LMS.Infrastructure.csproj", "LMS.Infrastructure/"]
  COPY ["LMS.Web/LMS.Web.csproj", "LMS.Web/"]
  
  RUN dotnet restore "LMS.Web/LMS.Web.csproj"
  RUN mkdir /lms-data
  
  COPY . .
  WORKDIR "/app/LMS.Web"
  
  CMD [ "/bin/bash","-c","dotnet restore &amp;&amp; dotnet watch run" ]
  </code></pre>
  
  <p><strong>My docker compose file is:</strong></p>
  
  <pre><code>version: "3.4"
  
  services:
    lmsapp:
      image: lmsapp
      container_name: lmsappv1
      build:
        context: .
        dockerfile: Dockerfile
      working_dir: "/app/LMS.Web"
      volumes: 
        - ".:/app"
      ports:
        - "5000:5000"
        - "5001:5001"
      networks: 
        - mongo_network
  
    mongodb:
      image: mongo
      container_name: mongo_db
      networks: 
        - mongo_network
      ports: 
        - "27017:27017"
  
  networks: 
    mongo_network:
      driver: bridge
  </code></pre>
  
  <p>Now when ever i run the the command docker-compose up after running docker-compose build</p>
  
  <p>I receive following error</p>
  
  <pre><code>System.ArgumentException: The path must be absolute. (Parameter 'root')
     at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
     at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root)
     at LMS.Web.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in /app/LMS.Web/Startup.cs:line 130
  </code></pre>
  
  <blockquote>
    <p><strong>How to solve this error?</strong></p>
  </blockquote>
  
  <p><strong>The other issue I am facing when ever I run the docker-compose up it always restore packages. How to avoid that?</strong></p>