'Output directory in docker is empty after copying files

I am fairly new to docker so please bare with me.

I am setting up a solution with a few projects, e.g. an API, API Gateway, UI project etc and am trying to get docker working with it. I have added dockerfiles to each of the projects and I have the docker-compose.yml and the docker-compose.override.yml file as well. I believe I have set up everything correctly, however when I view the 'app' folder in each of my containers I can see that no files are present within the folder. I expect to see all the necessary files to run the .NET core website (dll's, appsettings etc) but it's just an empty folder. I feel like something must be incorrect with either my Dockerfiles or the docker-compose file. Can anyone point me in the right direction please? I've added a picture to show the container file structure as seen from Visual Studio.

Can you think of any reason why the output folder would be empty?

Thanks.

Below is one of my Dockerfiles...

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["Gateway/Gateway/APIGateway.csproj", "Gateway/Gateway/"]
RUN dotnet restore "Gateway/Gateway/APIGateway.csproj"
COPY . .
WORKDIR "/src/Gateway/Gateway"
RUN dotnet build "APIGateway.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "APIGateway.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "APIGateway.dll"]
 

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source