Skip to content

Instantly share code, notes, and snippets.

@jsheridanwells
Last active September 1, 2020 14:14
Show Gist options
  • Save jsheridanwells/8b8fb949e88dfb21e372866cff60a51e to your computer and use it in GitHub Desktop.
Save jsheridanwells/8b8fb949e88dfb21e372866cff60a51e to your computer and use it in GitHub Desktop.
More or less the default Dockerfile that comes from the VS 2019 template
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
# See Also: https://docker-curriculum.com/#sf-food-trucks
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["AspNetCoreConfigExample.csproj", ""]
RUN dotnet restore "./AspNetCoreConfigExample.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "AspNetCoreConfigExample.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "AspNetCoreConfigExample.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENV Secret:SuperDuperSecret="Artie is my friend in the Dockerfile"
ENTRYPOINT ["dotnet", "AspNetCoreConfigExample.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment