Steve Adams
11/13/2023, 2:27 PMSebastiaan
11/13/2023, 3:48 PMdotnet publish
though (but I have no idea how to build a docker image).
I'll gently ping @CarlCod_es as well since you mentioned him š
CarlCod_es
11/13/2023, 4:33 PMCarlCod_es
11/13/2023, 4:34 PMCarlCod_es
11/13/2023, 4:34 PMAmbert
11/13/2023, 4:59 PMdocker
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["ProjectName/ProjectName.csproj", "ProjectName/"]
COPY ["ProjectName.Business/ProjectName.Business.csproj", "ProjectName.Business/"]
COPY ["ProjectName.Data/ProjectName.Data.csproj", "ProjectName.Data/"]
RUN dotnet restore "ProjectName/ProjectName.csproj"
COPY . .
WORKDIR "/src/ProjectName"
RUN dotnet build "ProjectName.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "ProjectName.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ProjectName.dll"]
Basically, restore, build, publish, and throw the result in the docker, runs like a charm here. Hope this gives you some pointersSteve Adams
11/14/2023, 12:39 AMSteve Adams
11/14/2023, 12:44 AMSteve Adams
11/14/2023, 12:50 AMdotnet dev-certs https --clean
To generate a new dv cert in my project's https folder:
dotnet dev-certs https -ep "https\project.pfx" -p {replace with your own password}
To trust my cert:
dotnet dev-certs https --trust
Steve Adams
11/14/2023, 12:52 AM