Skip to content

Commit

Permalink
chore: Update Dockerfiles for improved containerization
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-kastil committed Sep 2, 2024
1 parent 595a3f9 commit 2a50abf
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/services/catalog-service/dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
# Build Image
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
WORKDIR /app

RUN dotnet restore "catalog-service.csproj"
WORKDIR /build
COPY . .
WORKDIR "/app/catalog-service"

RUN dotnet build "catalog-service.csproj" -c Release -o /app/build
FROM build as publish
RUN dotnet publish "catalog-service.csproj" -c Release -o /app/publish
RUN dotnet restore "catalog-service.csproj"
RUN dotnet publish -c Release -o /app

# Runtime Image
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled AS final
WORKDIR /app
COPY --from=publish /app .
COPY --from=build /app .
ENTRYPOINT ["dotnet", "catalog-service.dll"]

# Build Image
Expand Down

0 comments on commit 2a50abf

Please sign in to comment.