From cd802762b9e2f0282d21622da0bf229f7100929a Mon Sep 17 00:00:00 2001 From: Meysam Hadeli <35596795+meysamhadeli@users.noreply.github.com> Date: Mon, 16 Sep 2024 22:20:27 +0330 Subject: [PATCH] chore: update dockerfiles for copy dependencies in root --- src/ApiGateway/Dockerfile | 15 +++++++-------- src/ApiGateway/dev.Dockerfile | 15 +++++++-------- src/Services/Booking/Dockerfile | 8 ++++---- src/Services/Booking/dev.Dockerfile | 8 ++++---- src/Services/Flight/Dockerfile | 8 ++++---- src/Services/Flight/dev.Dockerfile | 8 ++++---- src/Services/Identity/Dockerfile | 9 +++++---- src/Services/Identity/dev.Dockerfile | 9 +++++---- src/Services/Passenger/Dockerfile | 8 ++++---- src/Services/Passenger/dev.Dockerfile | 8 ++++---- 10 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/ApiGateway/Dockerfile b/src/ApiGateway/Dockerfile index 0f977880..bb2bb8b9 100644 --- a/src/ApiGateway/Dockerfile +++ b/src/ApiGateway/Dockerfile @@ -1,8 +1,11 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder -WORKDIR /src +WORKDIR / + +COPY ./.editorconfig ./ +COPY ./global.json ./ +COPY ./Directory.Build.props ./ # Setup working directory for the project -WORKDIR /src COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/ApiGateway/src/ApiGateway.csproj ./ApiGateway/src/ @@ -14,17 +17,13 @@ RUN dotnet restore ./ApiGateway/src/ApiGateway.csproj COPY ./src/BuildingBlocks ./BuildingBlocks/ COPY ./src/ApiGateway/src ./ApiGateway/src/ -COPY ./.editorconfig ./ -COPY ./global.json ./ -COPY ./Directory.Build.props ./ - # Build project with Release configuration # and no restore, as we did it already RUN ls RUN dotnet build -c Release --no-restore ./ApiGateway/src/ApiGateway.csproj -WORKDIR /src/ApiGateway/src +WORKDIR /ApiGateway/src # Publish project to output folder # and no build, as we did it already @@ -33,7 +32,7 @@ RUN dotnet publish -c Release --no-build -o out FROM mcr.microsoft.com/dotnet/aspnet:8.0 # Setup working directory for the project -WORKDIR /app +WORKDIR / COPY --from=builder /src/ApiGateway/src/out . ENV ASPNETCORE_URLS https://*:443, http://*:80 diff --git a/src/ApiGateway/dev.Dockerfile b/src/ApiGateway/dev.Dockerfile index b29a3959..dcea6820 100644 --- a/src/ApiGateway/dev.Dockerfile +++ b/src/ApiGateway/dev.Dockerfile @@ -1,8 +1,11 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder -WORKDIR /src +WORKDIR / + +COPY ./.editorconfig ./ +COPY ./global.json ./ +COPY ./Directory.Build.props ./ # Setup working directory for the project -WORKDIR /src COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/ApiGateway/src/ApiGateway.csproj ./ApiGateway/src/ @@ -15,10 +18,6 @@ RUN --mount=type=cache,id=gateway_nuget,target=/root/.nuget/packages \ COPY ./src/BuildingBlocks ./BuildingBlocks/ COPY ./src/ApiGateway/src ./ApiGateway/src/ -COPY ./.editorconfig ./ -COPY ./global.json ./ -COPY ./Directory.Build.props ./ - # Build project with Release configuration # and no restore, as we did it already @@ -26,7 +25,7 @@ RUN ls RUN --mount=type=cache,id=gateway_nuget,target=/root/.nuget/packages \ dotnet build -c Release --no-restore ./ApiGateway/src/ApiGateway.csproj -WORKDIR /src/ApiGateway/src +WORKDIR /ApiGateway/src # Publish project to output folder # and no build, as we did it already @@ -36,7 +35,7 @@ RUN --mount=type=cache,id=gateway_nuget,target=/root/.nuget/packages \ FROM mcr.microsoft.com/dotnet/aspnet:8.0 # Setup working directory for the project -WORKDIR /app +WORKDIR / COPY --from=builder /src/ApiGateway/src/out . ENV ASPNETCORE_URLS https://*:443, http://*:80 diff --git a/src/Services/Booking/Dockerfile b/src/Services/Booking/Dockerfile index 5892c23d..b6a88ca1 100644 --- a/src/Services/Booking/Dockerfile +++ b/src/Services/Booking/Dockerfile @@ -1,6 +1,10 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder WORKDIR / +COPY ./.editorconfig ./ +COPY ./global.json ./ +COPY ./Directory.Build.props ./ + # Setup working directory for the project COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/Services/Booking/src/Booking/Booking.csproj ./Services/Booking/src/Booking/ @@ -15,10 +19,6 @@ COPY ./src/BuildingBlocks ./BuildingBlocks/ COPY ./src/Services/Booking/src/Booking/ ./Services/Booking/src/Booking/ COPY ./src/Services/Booking/src/Booking.Api/ ./Services/Booking/src/Booking.Api/ -COPY ./.editorconfig ./ -COPY ./global.json ./ -COPY ./Directory.Build.props ./ - # Build project with Release configuration # and no restore, as we did it already diff --git a/src/Services/Booking/dev.Dockerfile b/src/Services/Booking/dev.Dockerfile index 3cfc72d9..4efa0b0b 100644 --- a/src/Services/Booking/dev.Dockerfile +++ b/src/Services/Booking/dev.Dockerfile @@ -1,6 +1,10 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder WORKDIR / +COPY ./.editorconfig ./ +COPY ./global.json ./ +COPY ./Directory.Build.props ./ + # Setup working directory for the project COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/Services/Booking/src/Booking/Booking.csproj ./Services/Booking/src/Booking/ @@ -16,10 +20,6 @@ COPY ./src/BuildingBlocks ./BuildingBlocks/ COPY ./src/Services/Booking/src/Booking/ ./Services/Booking/src/Booking/ COPY ./src/Services/Booking/src/Booking.Api/ ./Services/Booking/src/Booking.Api/ -COPY ./.editorconfig ./ -COPY ./global.json ./ -COPY ./Directory.Build.props ./ - # Build project with Release configuration # and no restore, as we did it already diff --git a/src/Services/Flight/Dockerfile b/src/Services/Flight/Dockerfile index 5b65e550..727dc0d6 100644 --- a/src/Services/Flight/Dockerfile +++ b/src/Services/Flight/Dockerfile @@ -1,6 +1,10 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder WORKDIR / +COPY ./.editorconfig ./ +COPY ./global.json ./ +COPY ./Directory.Build.props ./ + # Setup working directory for the project COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/Services/Flight/src/Flight/Flight.csproj ./Services/Flight/src/Flight/ @@ -15,10 +19,6 @@ COPY ./src/BuildingBlocks ./BuildingBlocks/ COPY ./src/Services/Flight/src/Flight/ ./Services/Flight/src/Flight/ COPY ./src/Services/Flight/src/Flight.Api/ ./Services/Flight/src/Flight.Api/ -COPY ./.editorconfig ./ -COPY ./global.json ./ -COPY ./Directory.Build.props ./ - # Build project with Release configuration # and no restore, as we did it already diff --git a/src/Services/Flight/dev.Dockerfile b/src/Services/Flight/dev.Dockerfile index 9cad2808..8f623ca5 100644 --- a/src/Services/Flight/dev.Dockerfile +++ b/src/Services/Flight/dev.Dockerfile @@ -1,6 +1,10 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder WORKDIR / +COPY ./.editorconfig ./ +COPY ./global.json ./ +COPY ./Directory.Build.props ./ + # Setup working directory for the project COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/Services/Flight/src/Flight/Flight.csproj ./Services/Flight/src/Flight/ @@ -16,10 +20,6 @@ COPY ./src/BuildingBlocks ./BuildingBlocks/ COPY ./src/Services/Flight/src/Flight/ ./Services/Flight/src/Flight/ COPY ./src/Services/Flight/src/Flight.Api/ ./Services/Flight/src/Flight.Api/ -COPY ./.editorconfig ./ -COPY ./global.json ./ -COPY ./Directory.Build.props ./ - # Build project with Release configuration # and no restore, as we did it already diff --git a/src/Services/Identity/Dockerfile b/src/Services/Identity/Dockerfile index 45d4a01a..71802165 100644 --- a/src/Services/Identity/Dockerfile +++ b/src/Services/Identity/Dockerfile @@ -2,6 +2,11 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder # Setup working directory for the project WORKDIR / + +COPY ./.editorconfig ./ +COPY ./global.json ./ +COPY ./Directory.Build.props ./ + COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/Services/Identity/src/Identity/Identity.csproj ./Services/Identity/src/Identity/ COPY ./src/Services/Identity/src/Identity.Api/Identity.Api.csproj ./Services/Identity/src/Identity.Api/ @@ -14,10 +19,6 @@ COPY ./src/BuildingBlocks ./BuildingBlocks/ COPY ./src/Services/Identity/src/Identity/ ./Services/Identity/src/Identity/ COPY ./src/Services/Identity/src/Identity.Api/ ./Services/Identity/src/Identity.Api/ -COPY ./.editorconfig ./ -COPY ./global.json ./ -COPY ./Directory.Build.props ./ - # Build project with Release configuration # and no restore, as we did it already diff --git a/src/Services/Identity/dev.Dockerfile b/src/Services/Identity/dev.Dockerfile index e70b031b..624a7ce5 100644 --- a/src/Services/Identity/dev.Dockerfile +++ b/src/Services/Identity/dev.Dockerfile @@ -2,6 +2,11 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder # Setup working directory for the project WORKDIR / + +COPY ./.editorconfig ./ +COPY ./global.json ./ +COPY ./Directory.Build.props ./ + COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/Services/Identity/src/Identity/Identity.csproj ./Services/Identity/src/Identity/ COPY ./src/Services/Identity/src/Identity.Api/Identity.Api.csproj ./Services/Identity/src/Identity.Api/ @@ -15,10 +20,6 @@ COPY ./src/BuildingBlocks ./BuildingBlocks/ COPY ./src/Services/Identity/src/Identity/ ./Services/Identity/src/Identity/ COPY ./src/Services/Identity/src/Identity.Api/ ./Services/Identity/src/Identity.Api/ -COPY ./.editorconfig ./ -COPY ./global.json ./ -COPY ./Directory.Build.props ./ - # Build project with Release configuration # and no restore, as we did it already diff --git a/src/Services/Passenger/Dockerfile b/src/Services/Passenger/Dockerfile index 9fdaa86d..8ff7507f 100644 --- a/src/Services/Passenger/Dockerfile +++ b/src/Services/Passenger/Dockerfile @@ -1,6 +1,10 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder WORKDIR / +COPY ./.editorconfig ./ +COPY ./global.json ./ +COPY ./Directory.Build.props ./ + # Setup working directory for the project COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/Services/Passenger/src/Passenger/Passenger.csproj ./Services/Passenger/src/Passenger/ @@ -15,10 +19,6 @@ COPY ./src/BuildingBlocks ./BuildingBlocks/ COPY ./src/Services/Passenger/src/Passenger/ ./Services/Passenger/src/Passenger/ COPY ./src/Services/Passenger/src/Passenger.Api/ ./Services/Passenger/src/Passenger.Api/ -COPY ./.editorconfig ./ -COPY ./global.json ./ -COPY ./Directory.Build.props ./ - # Build project with Release configuration # and no restore, as we did it already diff --git a/src/Services/Passenger/dev.Dockerfile b/src/Services/Passenger/dev.Dockerfile index 262cf265..34d01496 100644 --- a/src/Services/Passenger/dev.Dockerfile +++ b/src/Services/Passenger/dev.Dockerfile @@ -1,6 +1,10 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder WORKDIR / +COPY ./.editorconfig ./ +COPY ./global.json ./ +COPY ./Directory.Build.props ./ + # Setup working directory for the project COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/Services/Passenger/src/Passenger/Passenger.csproj ./Services/Passenger/src/Passenger/ @@ -16,10 +20,6 @@ COPY ./src/BuildingBlocks ./BuildingBlocks/ COPY ./src/Services/Passenger/src/Passenger/ ./Services/Passenger/src/Passenger/ COPY ./src/Services/Passenger/src/Passenger.Api/ ./Services/Passenger/src/Passenger.Api/ -COPY ./.editorconfig ./ -COPY ./global.json ./ -COPY ./Directory.Build.props ./ - # Build project with Release configuration # and no restore, as we did it already