handlebars.aspnetcore.Dockerfile.mustache Maven / Gradle / Ivy
FROM microsoft/aspnetcore-build:{{aspNetCoreVersion}} AS build-env
WORKDIR /app
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
# copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
# build runtime image
FROM microsoft/aspnetcore:{{aspNetCoreVersion}}
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "{{packageName}}.dll"]