Simplify Dockerfile: copy all src at once
This commit is contained in:
24
Dockerfile
24
Dockerfile
@@ -1,27 +1,13 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
COPY src/FrontOffice.BFF.sln ./
|
# Copy all source files
|
||||||
COPY src/FrontOffice.BFF.WebApi/*.csproj ./FrontOffice.BFF.WebApi/
|
|
||||||
COPY src/FrontOffice.BFF.Application/*.csproj ./FrontOffice.BFF.Application/
|
|
||||||
COPY src/FrontOffice.BFF.Infrastructure/*.csproj ./FrontOffice.BFF.Infrastructure/
|
|
||||||
COPY src/FrontOffice.BFF.Domain/*.csproj ./FrontOffice.BFF.Domain/
|
|
||||||
COPY src/Protobufs/FrontOffice.BFF.Commission.Protobuf/*.csproj ./Protobufs/FrontOffice.BFF.Commission.Protobuf/
|
|
||||||
COPY src/Protobufs/FrontOffice.BFF.UserWallet.Protobuf/*.csproj ./Protobufs/FrontOffice.BFF.UserWallet.Protobuf/
|
|
||||||
COPY src/Protobufs/FrontOffice.BFF.User.Protobuf/*.csproj ./Protobufs/FrontOffice.BFF.User.Protobuf/
|
|
||||||
COPY src/Protobufs/FrontOffice.BFF.DiscountShop.Protobuf/*.csproj ./Protobufs/FrontOffice.BFF.DiscountShop.Protobuf/
|
|
||||||
COPY src/Protobufs/FrontOffice.BFF.Package.Protobuf/*.csproj ./Protobufs/FrontOffice.BFF.Package.Protobuf/
|
|
||||||
COPY src/Protobufs/FrontOffice.BFF.ShopingCart.Protobuf/*.csproj ./Protobufs/FrontOffice.BFF.ShopingCart.Protobuf/
|
|
||||||
COPY src/Protobufs/FrontOffice.BFF.UserOrder.Protobuf/*.csproj ./Protobufs/FrontOffice.BFF.UserOrder.Protobuf/
|
|
||||||
COPY src/Protobufs/FrontOffice.BFF.ClubMembership.Protobuf/*.csproj ./Protobufs/FrontOffice.BFF.ClubMembership.Protobuf/
|
|
||||||
COPY src/Protobufs/FrontOffice.BFF.UserAddress.Protobuf/*.csproj ./Protobufs/FrontOffice.BFF.UserAddress.Protobuf/
|
|
||||||
COPY src/Protobufs/FrontOffice.BFF.Products.Protobuf/*.csproj ./Protobufs/FrontOffice.BFF.Products.Protobuf/
|
|
||||||
COPY src/Protobufs/FrontOffice.BFF.NetworkMembership.Protobuf/*.csproj ./Protobufs/FrontOffice.BFF.NetworkMembership.Protobuf/
|
|
||||||
|
|
||||||
RUN dotnet restore "FrontOffice.BFF.WebApi/FrontOffice.BFF.WebApi.csproj"
|
|
||||||
|
|
||||||
COPY src/ ./
|
COPY src/ ./
|
||||||
|
|
||||||
|
# Restore dependencies
|
||||||
|
RUN dotnet restore "FrontOffice.BFF.WebApi/FrontOffice.BFF.WebApi.csproj"
|
||||||
|
|
||||||
|
# Build and publish
|
||||||
RUN dotnet publish "FrontOffice.BFF.WebApi/FrontOffice.BFF.WebApi.csproj" -c Release -o /app/publish --no-restore
|
RUN dotnet publish "FrontOffice.BFF.WebApi/FrontOffice.BFF.WebApi.csproj" -c Release -o /app/publish --no-restore
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
|
||||||
|
|||||||
Reference in New Issue
Block a user