sledgemapper/Dockerfile

30 lines
739 B
Docker
Raw Permalink Normal View History

2020-11-26 22:34:16 +00:00
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
2020-11-06 20:08:27 +00:00
WORKDIR /src
# copy csproj and restore as distinct layers
COPY Sledgemapper.Api/*.csproj ./Sledgemapper.Api/
COPY Sledgemapper.Shared/*.csproj ./Sledgemapper.Shared/
WORKDIR /src/Sledgemapper.Api
RUN dotnet restore
WORKDIR /src/Sledgemapper.Shared
RUN dotnet restore
2020-11-24 19:09:34 +00:00
WORKDIR /src/Sledgemapper
2020-11-25 22:06:59 +00:00
# RUN dotnet restore
2020-11-24 19:09:34 +00:00
2020-11-06 20:08:27 +00:00
# copy everything else and build app
WORKDIR /src
COPY Sledgemapper.Api/. ./Sledgemapper.Api/
COPY Sledgemapper.Shared/. ./Sledgemapper.Shared/
2020-11-24 19:09:34 +00:00
2020-11-06 20:08:27 +00:00
WORKDIR /src/Sledgemapper.Api
RUN dotnet publish -c release -o /app --no-restore
# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:5.0
WORKDIR /app
COPY --from=build /app ./
2020-11-23 22:53:32 +00:00
ENTRYPOINT ["dotnet", "Sledgemapper.Api.dll"]