Skip to content

Commit

Permalink
Simplify docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
merschformann committed Sep 15, 2024
1 parent bedc752 commit 597903e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions SC.Service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["SC.Service/SC.Service.csproj", "SC.Service/"]
RUN dotnet restore "SC.Service/SC.Service.csproj"
COPY . .
WORKDIR "/src/SC.Service"
RUN dotnet build "SC.Service.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "SC.Service.csproj" -c Release -o /app/publish

FROM base AS final
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
LABEL org.opencontainers.image.source="https://github.com/merschformann/sardine-can"
WORKDIR /app
COPY --from=publish /app/publish .
EXPOSE 80
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "SC.Service.dll"]

0 comments on commit 597903e

Please sign in to comment.