You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
584 B
Docker

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# .Net5 WebApiÀý×Ó
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["DockerStudyApi/DockerStudyApi.csproj", "DockerStudyApi/"]
RUN dotnet restore "DockerStudyApi/DockerStudyApi.csproj"
COPY . .
WORKDIR "/src/DockerStudyApi"
RUN dotnet build "DockerStudyApi.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "DockerStudyApi.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "DockerStudyApi.dll"]