Skip to content

Instantly share code, notes, and snippets.

@Jtorrecilla
Created April 9, 2019 19:59
Show Gist options
  • Select an option

  • Save Jtorrecilla/0d3ef746e18c8db36854edfc8227fcb4 to your computer and use it in GitHub Desktop.

Select an option

Save Jtorrecilla/0d3ef746e18c8db36854edfc8227fcb4 to your computer and use it in GitHub Desktop.
Initial Docker Azure Artifact
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /src
COPY / /src/Services/MyApi/
WORKDIR /src/Services/MyApi/MyApi.Api
RUN dotnet restore MyApi.csproj -nowarn:msb3202,nu1503
FROM build AS publish
RUN dotnet build MyApi.csproj --no-restore -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "MyApi.dll"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment