Files
webapitest/Dockerfile
2026-03-03 17:54:49 +02:00

27 lines
523 B
Docker

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["SampleApi/SampleApi.csproj", "SampleApi/"]
RUN dotnet restore "SampleApi/SampleApi.csproj"
COPY . .
RUN dotnet publish "SampleApi/SampleApi.csproj" \
-c Release \
-o /app/publish \
--no-restore \
/p:UseAppHost=false
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
ENV ASPNETCORE_HTTP_PORTS=8081
EXPOSE 8081
COPY --from=build /app/publish .
RUN ls -la /app
ENV ASPNETCORE_HTTP_PORTS=8081
ENTRYPOINT ["dotnet", "SampleApi.dll"]