Skip to content

Instantly share code, notes, and snippets.

@Defcoq
Last active October 3, 2019 15:08
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 Defcoq/1600a25e99af6605a7d14b1d3f604549 to your computer and use it in GitHub Desktop.
Save Defcoq/1600a25e99af6605a7d14b1d3f604549 to your computer and use it in GitHub Desktop.
a visual studio docker file autogenerate creating an MVC core web application
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /src
COPY ["CustomGridViewAndTagCloud/CustomGridViewAndTagCloud.csproj", "CustomGridViewAndTagCloud/"]
RUN dotnet restore "CustomGridViewAndTagCloud/CustomGridViewAndTagCloud.csproj"
COPY . .
WORKDIR "/src/CustomGridViewAndTagCloud"
RUN dotnet build "CustomGridViewAndTagCloud.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "CustomGridViewAndTagCloud.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "CustomGridViewAndTagCloud.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment