title: Docker Compose fails on copy
body: <p>I am trying to setup a docker compose deployment but I have having an issue with the COPY that is in one of the projects. I have tried changing the path a few times without any luck. I continue to get the following issue:</p>
  <pre><code>ERROR: Service 'cryptoappapi' failed to build : COPY failed: file not found in 
  build context or excluded by .dockerignore: stat 
  CryptoApp.Api/CryptoApp.Api.csproj: file does not exist
  </code></pre>
  <p>This is my layout</p>
  <p><a href="https://i.stack.imgur.com/7toLM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7toLM.png" alt="enter image description here" /></a></p>
  <p>This is my docker file is standard:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
  WORKDIR /app
  EXPOSE 80
  EXPOSE 443
  
  FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
  WORKDIR /src
  COPY [&quot;CryptoApp.Api/CryptoApp.Api.csproj&quot;, &quot;CryptoApp.Api/&quot;]
  RUN dotnet restore &quot;CryptoApp.Api/CryptoApp.Api.csproj&quot;
  COPY . .
  WORKDIR &quot;/src/CryptoApp.Api&quot;
  RUN dotnet build &quot;CryptoApp.Api.csproj&quot; -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish &quot;CryptoApp.Api.csproj&quot; -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app/publish .
  ENTRYPOINT [&quot;dotnet&quot;, &quot;CryptoApp.Api.dll&quot;]
  </code></pre>
  <p>This is my docker compose:</p>
  <pre><code>services:
    # First the AspNet Core app
    cryptoappapi:
      ## Get the image to use and set the container name
      image: cryptoappapi:latest
      container_name: cryptoappapi
  
      # State a dependancy on Redis working
      depends_on:
        - &quot;redis_image&quot;
        - &quot;postgres_image&quot;
  
      # Location of the Dockerfile
      build:
        context: ./CryptoApp.Api
        dockerfile: Dockerfile
  
      # Set access ports for localhost on the left
      ports:
        - &quot;80:5000&quot;
        - &quot;443:5001&quot;
  
      # Configure a link to Redis
      links:
        - &quot;redis_image&quot;
        - &quot;postgres_image&quot;
  
      # The Application needs a connection string for Redis, this just needs to be the Redis Service name as defined below
      # Pass it in as an Environmental Variable
      environment:
        - RedisConnection=redis_image
        - DB_CONNECTION_STRING=&quot;host=postgres_image;port=5432;database=xx;username=xxx;password=xxx&quot;
      
      # Set them all to the same network
      networks:
        - dockerapi-dev  
  </code></pre>