Skip to content

Instantly share code, notes, and snippets.

@bbachi
Created February 27, 2021 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbachi/f8d94e88dbc5def0f19448a39cc5c9a5 to your computer and use it in GitHub Desktop.
Save bbachi/f8d94e88dbc5def0f19448a39cc5c9a5 to your computer and use it in GitHub Desktop.
Angular DOTNET
# https://hub.docker.com/_/microsoft-dotnet
FROM mcr.microsoft.com/dotnet/sdk:5.0.103 AS build
WORKDIR /build
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs
# copy csproj and restore as distinct layers
COPY ./*.csproj .
RUN dotnet restore
# copy everything else and build app
COPY . .
WORKDIR /build
RUN dotnet publish -c release -o published --no-cache
# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:5.0
WORKDIR /app
COPY --from=build /build/published ./
ENTRYPOINT ["dotnet", "angular-dotnet-example.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment