Skip to content

Commit

Permalink
Merge pull request #306 from meysamhadeli/chore/update-dockerfiles-fo…
Browse files Browse the repository at this point in the history
…r-copy-dependencies-in-root

chore: update dockerfiles for copy dependencies in root
  • Loading branch information
meysamhadeli authored Sep 16, 2024
2 parents b6dc2c5 + cd80276 commit 092ecde
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 48 deletions.
15 changes: 7 additions & 8 deletions src/ApiGateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/

Expand All @@ -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
Expand All @@ -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
Expand Down
15 changes: 7 additions & 8 deletions src/ApiGateway/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -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/

Expand All @@ -15,18 +18,14 @@ 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

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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/Services/Booking/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/Services/Booking/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/Services/Flight/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/Services/Flight/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -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

Expand Down
9 changes: 5 additions & 4 deletions src/Services/Identity/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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

Expand Down
9 changes: 5 additions & 4 deletions src/Services/Identity/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/Services/Passenger/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/Services/Passenger/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -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

Expand Down

0 comments on commit 092ecde

Please sign in to comment.