Created
May 6, 2024 17:33
-
-
Save alpersilistre/64cc89cbb8e9f810492f8a59ab25accb to your computer and use it in GitHub Desktop.
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
# https://hub.docker.com/_/microsoft-dotnet | |
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build | |
WORKDIR /app | |
EXPOSE 80 | |
EXPOSE 443 | |
# copy csproj and restore as distinct layers | |
COPY ComplexApp.Core/*.csproj ComplexApp.Core/ | |
COPY ComplexApp.Web/*.csproj ComplexApp.Web/ | |
RUN dotnet restore ComplexApp.Web | |
COPY . . | |
RUN dotnet publish ComplexApp.Web -c Release -o out --no-restore | |
# final stage/image | |
FROM mcr.microsoft.com/dotnet/aspnet:6.0 | |
ENV ASPNETCORE_URLS=http://*:${PORT} | |
WORKDIR /app | |
COPY --from=build /app/out . | |
ENTRYPOINT ["dotnet", "ComplexApp.Web.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment