Skip to content

Instantly share code, notes, and snippets.

@felipebossolani
Created January 2, 2020 22:44
Show Gist options
  • Save felipebossolani/ea04b1ab5457e4acd49c968d7ef9c3d0 to your computer and use it in GitHub Desktop.
Save felipebossolani/ea04b1ab5457e4acd49c968d7ef9c3d0 to your computer and use it in GitHub Desktop.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["app.csproj", ""]
RUN dotnet restore "./app.csproj"
COPY . .
WORKDIR /src
RUN dotnet build "app.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "app.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
RUN dotnet --version
ENV ASPNETCORE_URLS http://*:5000
EXPOSE 5000
ENTRYPOINT ["dotnet", "app/app.dll", "--server.urls", "http://*:5000"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment