Skip to content

Instantly share code, notes, and snippets.

@srasch
Created April 29, 2019 06:57
Show Gist options
  • Save srasch/7891cad651ea1bc4d491cd8405a5af73 to your computer and use it in GitHub Desktop.
Save srasch/7891cad651ea1bc4d491cd8405a5af73 to your computer and use it in GitHub Desktop.
FROM mcr.microsoft.com/dotnet/core/aspnet:2.1-stretch-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:2.1-stretch AS build
WORKDIR /src
COPY ["UI/UI.csproj", "UI/"]
COPY ["Models/Models.csproj", "Models/"]
RUN dotnet restore "UI/UI.csproj"
COPY . .
WORKDIR "/src/UI"
RUN dotnet build "UI.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "UI.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "UI.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment