Docker file cant find csproj while deploy
My docker compose yml file in main directory
version: "3.7"
services:
reverseproxy:
image: fff
build:
context: ./Nginx
dockerfile: Dockerfile
ports:
- "80:80"
- "443:443"
restart: always
api:
image: bbb
depends_on:
- reverseproxy
build:
context: ./RentServiceApp
dockerfile: Dockerfile
expose:
- "5000"
restart: always
My docker file in RentServiceApp
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["RentServiceApp.csproj", "./"]
COPY ["../RentService.Common/RentService.Common.csproj", "./"]
RUN dotnet restore "./RentServiceApp.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "RentServiceApp.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "RentServiceApp.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENV ASPNETCORE_URLS http://*:5000
ENTRYPOINT ["dotnet", "RentServiceApp.dll"]
RentServiceApp is main project
RentServiceCommon is library project
example taked from https://github.com/tonysneed/Demo.AspNetCore-Nginx-Ssl