Created
March 11, 2023 13:11
-
-
Save atlemagnussen/8319b79858eed421c1146b97a187d84a to your computer and use it in GitHub Desktop.
asp.net 6 dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#See https://aka.ms/customizecontainer to learn how to customize your debug container and 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 ["WebApplication1/WebApplication1.csproj", "WebApplication1/"] | |
RUN dotnet restore "WebApplication1/WebApplication1.csproj" | |
COPY . . | |
WORKDIR "/src/WebApplication1" | |
RUN dotnet build "WebApplication1.csproj" -c Release -o /app/build | |
FROM build AS publish | |
RUN dotnet publish "WebApplication1.csproj" -c Release -o /app/publish /p:UseAppHost=false | |
FROM base AS final | |
WORKDIR /app | |
COPY --from=publish /app/publish . | |
ENTRYPOINT ["dotnet", "WebApplication1.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment