mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-18 01:42:10 +08:00
feat: add architecture style to project
This commit is contained in:
parent
76551a21f2
commit
ccce0faef1
40
.github/workflows/ci.yml
vendored
40
.github/workflows/ci.yml
vendored
@ -20,13 +20,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build and Test Flight
|
- name: Build and Test Flight Microservice
|
||||||
uses: ./.github/actions/build-test
|
uses: ./.github/actions/build-test
|
||||||
if: success()
|
if: success()
|
||||||
id: build-test-flight-step
|
id: build-test-flight-step
|
||||||
with:
|
with:
|
||||||
project-path: 'src/Services/Flight/src/Flight.Api'
|
project-path: '3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api'
|
||||||
tests-path: 'src/Services/Flight/tests/'
|
tests-path: '3-Microservices-Architecture-Style/src/Services/Flight/tests/'
|
||||||
# wildcard search for files with the ".cobertura.xml" extension in all subdirectories of the current directory
|
# wildcard search for files with the ".cobertura.xml" extension in all subdirectories of the current directory
|
||||||
# https://www.jamescroft.co.uk/combining-multiple-code-coverage-results-in-azure-devops/
|
# https://www.jamescroft.co.uk/combining-multiple-code-coverage-results-in-azure-devops/
|
||||||
# https://stackoverflow.com/questions/53255065/dotnet-unit-test-with-coverlet-how-to-get-coverage-for-entire-solution-and-not
|
# https://stackoverflow.com/questions/53255065/dotnet-unit-test-with-coverlet-how-to-get-coverage-for-entire-solution-and-not
|
||||||
@ -35,13 +35,13 @@ jobs:
|
|||||||
service-name: 'Flight'
|
service-name: 'Flight'
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and Test Identity
|
- name: Build and Test Identity Microservice
|
||||||
uses: ./.github/actions/build-test
|
uses: ./.github/actions/build-test
|
||||||
if: success()
|
if: success()
|
||||||
id: build-test-identity-step
|
id: build-test-identity-step
|
||||||
with:
|
with:
|
||||||
project-path: 'src/Services/Identity/src/Identity.Api'
|
project-path: '3-Microservices-Architecture-Style/src/Services/Identity/src/Identity.Api'
|
||||||
tests-path: 'src/Services/Identity/tests/'
|
tests-path: '3-Microservices-Architecture-Style/src/Services/Identity/tests/'
|
||||||
# wildcard search for files with the ".cobertura.xml" extension in all subdirectories of the current directory
|
# wildcard search for files with the ".cobertura.xml" extension in all subdirectories of the current directory
|
||||||
# https://www.jamescroft.co.uk/combining-multiple-code-coverage-results-in-azure-devops/
|
# https://www.jamescroft.co.uk/combining-multiple-code-coverage-results-in-azure-devops/
|
||||||
# https://stackoverflow.com/questions/53255065/dotnet-unit-test-with-coverlet-how-to-get-coverage-for-entire-solution-and-not
|
# https://stackoverflow.com/questions/53255065/dotnet-unit-test-with-coverlet-how-to-get-coverage-for-entire-solution-and-not
|
||||||
@ -50,13 +50,13 @@ jobs:
|
|||||||
service-name: 'Identity'
|
service-name: 'Identity'
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and Test Passenger
|
- name: Build and Test Passenger Microservice
|
||||||
uses: ./.github/actions/build-test
|
uses: ./.github/actions/build-test
|
||||||
if: success()
|
if: success()
|
||||||
id: build-test-passenger-step
|
id: build-test-passenger-step
|
||||||
with:
|
with:
|
||||||
project-path: 'src/Services/Passenger/src/Passenger.Api'
|
project-path: '3-Microservices-Architecture-Style/src/Services/Passenger/src/Passenger.Api'
|
||||||
tests-path: 'src/Services/Passenger/tests/'
|
tests-path: '3-Microservices-Architecture-Style/src/Services/Passenger/tests/'
|
||||||
# wildcard search for files with the ".cobertura.xml" extension in all subdirectories of the current directory
|
# wildcard search for files with the ".cobertura.xml" extension in all subdirectories of the current directory
|
||||||
# https://www.jamescroft.co.uk/combining-multiple-code-coverage-results-in-azure-devops/
|
# https://www.jamescroft.co.uk/combining-multiple-code-coverage-results-in-azure-devops/
|
||||||
# https://stackoverflow.com/questions/53255065/dotnet-unit-test-with-coverlet-how-to-get-coverage-for-entire-solution-and-not
|
# https://stackoverflow.com/questions/53255065/dotnet-unit-test-with-coverlet-how-to-get-coverage-for-entire-solution-and-not
|
||||||
@ -65,13 +65,13 @@ jobs:
|
|||||||
service-name: 'Passenger'
|
service-name: 'Passenger'
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and Test Booking
|
- name: Build and Test Booking Microservice
|
||||||
uses: ./.github/actions/build-test
|
uses: ./.github/actions/build-test
|
||||||
if: success()
|
if: success()
|
||||||
id: build-test-booking-step
|
id: build-test-booking-step
|
||||||
with:
|
with:
|
||||||
project-path: 'src/Services/Booking/src/Booking.Api'
|
project-path: '3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api'
|
||||||
tests-path: 'src/Services/Booking/tests/'
|
tests-path: '3-Microservices-Architecture-Style/src/Services/Booking/tests/'
|
||||||
# wildcard search for files with the ".cobertura.xml" extension in all subdirectories of the current directory
|
# wildcard search for files with the ".cobertura.xml" extension in all subdirectories of the current directory
|
||||||
# https://www.jamescroft.co.uk/combining-multiple-code-coverage-results-in-azure-devops/
|
# https://www.jamescroft.co.uk/combining-multiple-code-coverage-results-in-azure-devops/
|
||||||
# https://stackoverflow.com/questions/53255065/dotnet-unit-test-with-coverlet-how-to-get-coverage-for-entire-solution-and-not
|
# https://stackoverflow.com/questions/53255065/dotnet-unit-test-with-coverlet-how-to-get-coverage-for-entire-solution-and-not
|
||||||
@ -91,42 +91,42 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
echo "Release version is:" ${{ steps.last_release.outputs.tag_name }}
|
echo "Release version is:" ${{ steps.last_release.outputs.tag_name }}
|
||||||
|
|
||||||
- name: Build and Publish Identity to Docker
|
- name: Build and Publish Identity Microservice to Docker
|
||||||
if: ${{ github.ref == 'refs/heads/main' && success() }}
|
if: ${{ github.ref == 'refs/heads/main' && success() }}
|
||||||
uses: ./.github/actions/docker-build-publish
|
uses: ./.github/actions/docker-build-publish
|
||||||
with:
|
with:
|
||||||
tag-name: ${{ steps.last_release.outputs.tag_name }}
|
tag-name: ${{ steps.last_release.outputs.tag_name }}
|
||||||
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
dockerfile-path: 'src/Services/Identity/Dockerfile'
|
dockerfile-path: '3-Microservices-Architecture-Style/src/Services/Identity/Dockerfile'
|
||||||
image-name: 'booking-microservices-identity'
|
image-name: 'booking-microservices-identity'
|
||||||
|
|
||||||
- name: Build and Publish Flight to Docker
|
- name: Build and Publish Flight Microservice to Docker
|
||||||
if: ${{ github.ref == 'refs/heads/main' && success() }}
|
if: ${{ github.ref == 'refs/heads/main' && success() }}
|
||||||
uses: ./.github/actions/docker-build-publish
|
uses: ./.github/actions/docker-build-publish
|
||||||
with:
|
with:
|
||||||
tag-name: ${{ steps.last_release.outputs.tag_name }}
|
tag-name: ${{ steps.last_release.outputs.tag_name }}
|
||||||
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
dockerfile-path: 'src/Services/Flight/Dockerfile'
|
dockerfile-path: '3-Microservices-Architecture-Style/src/Services/Flight/Dockerfile'
|
||||||
image-name: 'booking-microservices-flight'
|
image-name: 'booking-microservices-flight'
|
||||||
|
|
||||||
- name: Build and Publish Passenger to Docker
|
- name: Build and Publish Passenger Microservice to Docker
|
||||||
if: ${{ github.ref == 'refs/heads/main' && success() }}
|
if: ${{ github.ref == 'refs/heads/main' && success() }}
|
||||||
uses: ./.github/actions/docker-build-publish
|
uses: ./.github/actions/docker-build-publish
|
||||||
with:
|
with:
|
||||||
tag-name: ${{ steps.last_release.outputs.tag_name }}
|
tag-name: ${{ steps.last_release.outputs.tag_name }}
|
||||||
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
dockerfile-path: 'src/Services/Passenger/Dockerfile'
|
dockerfile-path: '3-Microservices-Architecture-Style/src/Services/Passenger/Dockerfile'
|
||||||
image-name: 'booking-microservices-passenger'
|
image-name: 'booking-microservices-passenger'
|
||||||
|
|
||||||
- name: Build and Publish Booking to Docker
|
- name: Build and Publish Booking Microservice to Docker
|
||||||
if: ${{ github.ref == 'refs/heads/main' && success() }}
|
if: ${{ github.ref == 'refs/heads/main' && success() }}
|
||||||
uses: ./.github/actions/docker-build-publish
|
uses: ./.github/actions/docker-build-publish
|
||||||
with:
|
with:
|
||||||
tag-name: ${{ steps.last_release.outputs.tag_name }}
|
tag-name: ${{ steps.last_release.outputs.tag_name }}
|
||||||
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
registry-password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
dockerfile-path: 'src/Services/Booking/Dockerfile'
|
dockerfile-path: '3-Microservices-Architecture-Style/src/Services/Booking/Dockerfile'
|
||||||
image-name: 'booking-microservices-booking'
|
image-name: 'booking-microservices-booking'
|
||||||
|
|||||||
0
1-Monolith-Architecture-Style/.gitkeep
Normal file
0
1-Monolith-Architecture-Style/.gitkeep
Normal file
0
2-Modular-Monolith-Architecture-Style/.gitkeep
Normal file
0
2-Modular-Monolith-Architecture-Style/.gitkeep
Normal file
45
3-Microservices-Architecture-Style/src/ApiGateway/Dockerfile
Normal file
45
3-Microservices-Architecture-Style/src/ApiGateway/Dockerfile
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS builder
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
COPY ./.editorconfig ./
|
||||||
|
COPY ./global.json ./
|
||||||
|
COPY ./Directory.Build.props ./
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
COPY ./BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/ApiGateway/src/ApiGateway.csproj ./3-Microservices-Architecture-Style/src/ApiGateway/src/
|
||||||
|
|
||||||
|
|
||||||
|
# Restore nuget packages
|
||||||
|
RUN dotnet restore ./3-Microservices-Architecture-Style/src/ApiGateway/src/ApiGateway.csproj
|
||||||
|
|
||||||
|
# Copy project files
|
||||||
|
COPY ./BuildingBlocks ./BuildingBlocks/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/ApiGateway/src ./3-Microservices-Architecture-Style/src/ApiGateway/src/
|
||||||
|
|
||||||
|
# Build project with Release configuration
|
||||||
|
# and no restore, as we did it already
|
||||||
|
|
||||||
|
RUN ls
|
||||||
|
RUN dotnet build -c Release --no-restore ./3-Microservices-Architecture-Style/src/ApiGateway/src/ApiGateway.csproj
|
||||||
|
|
||||||
|
WORKDIR /3-Microservices-Architecture-Style/src/ApiGateway/src
|
||||||
|
|
||||||
|
# Publish project to output folder
|
||||||
|
# and no build, as we did it already
|
||||||
|
RUN dotnet publish -c Release --no-build -o out
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /3-Microservices-Architecture-Style/src/ApiGateway/src/out .
|
||||||
|
|
||||||
|
ENV ASPNETCORE_URLS https://*:443, http://*:80
|
||||||
|
ENV ASPNETCORE_ENVIRONMENT docker
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "ApiGateway.dll"]
|
||||||
|
|
||||||
@ -6,26 +6,26 @@ COPY ./global.json ./
|
|||||||
COPY ./Directory.Build.props ./
|
COPY ./Directory.Build.props ./
|
||||||
|
|
||||||
# Setup working directory for the project
|
# Setup working directory for the project
|
||||||
COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/
|
COPY ./BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/
|
||||||
COPY ./src/ApiGateway/src/ApiGateway.csproj ./ApiGateway/src/
|
COPY ./3-Microservices-Architecture-Style/src/ApiGateway/src/ApiGateway.csproj ./3-Microservices-Architecture-Style/src/ApiGateway/src/
|
||||||
|
|
||||||
|
|
||||||
# Restore nuget packages
|
# Restore nuget packages
|
||||||
RUN --mount=type=cache,id=gateway_nuget,target=/root/.nuget/packages \
|
RUN --mount=type=cache,id=gateway_nuget,target=/root/.nuget/packages \
|
||||||
dotnet restore ./ApiGateway/src/ApiGateway.csproj
|
dotnet restore ./3-Microservices-Architecture-Style/src/ApiGateway/src/ApiGateway.csproj
|
||||||
|
|
||||||
# Copy project files
|
# Copy project files
|
||||||
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
COPY ./BuildingBlocks ./BuildingBlocks/
|
||||||
COPY ./src/ApiGateway/src ./ApiGateway/src/
|
COPY ./3-Microservices-Architecture-Style/src/ApiGateway/src ./3-Microservices-Architecture-Style/src/ApiGateway/src/
|
||||||
|
|
||||||
# Build project with Release configuration
|
# Build project with Release configuration
|
||||||
# and no restore, as we did it already
|
# and no restore, as we did it already
|
||||||
|
|
||||||
RUN ls
|
RUN ls
|
||||||
RUN --mount=type=cache,id=gateway_nuget,target=/root/.nuget/packages \
|
RUN --mount=type=cache,id=gateway_nuget,target=/root/.nuget/packages \
|
||||||
dotnet build -c Release --no-restore ./ApiGateway/src/ApiGateway.csproj
|
dotnet build -c Release --no-restore ./3-Microservices-Architecture-Style/src/ApiGateway/src/ApiGateway.csproj
|
||||||
|
|
||||||
WORKDIR /ApiGateway/src
|
WORKDIR /3-Microservices-Architecture-Style/src/ApiGateway/src
|
||||||
|
|
||||||
# Publish project to output folder
|
# Publish project to output folder
|
||||||
# and no build, as we did it already
|
# and no build, as we did it already
|
||||||
@ -36,7 +36,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
|||||||
|
|
||||||
# Setup working directory for the project
|
# Setup working directory for the project
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
COPY --from=builder /src/ApiGateway/src/out .
|
COPY --from=builder /3-Microservices-Architecture-Style/src/ApiGateway/src/out .
|
||||||
|
|
||||||
ENV ASPNETCORE_URLS https://*:443, http://*:80
|
ENV ASPNETCORE_URLS https://*:443, http://*:80
|
||||||
ENV ASPNETCORE_ENVIRONMENT docker
|
ENV ASPNETCORE_ENVIRONMENT docker
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\..\BuildingBlocks\BuildingBlocks.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS builder
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
COPY ./.editorconfig ./
|
||||||
|
COPY ./global.json ./
|
||||||
|
COPY ./Directory.Build.props ./
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
COPY ./BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking/Booking.csproj ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/Booking.Api.csproj ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/
|
||||||
|
|
||||||
|
|
||||||
|
# Restore nuget packages
|
||||||
|
RUN dotnet restore ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/Booking.Api.csproj
|
||||||
|
|
||||||
|
# Copy project files
|
||||||
|
COPY ./BuildingBlocks ./BuildingBlocks/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking/ ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/ ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/
|
||||||
|
|
||||||
|
# Build project with Release configuration
|
||||||
|
# and no restore, as we did it already
|
||||||
|
|
||||||
|
RUN ls
|
||||||
|
RUN dotnet build -c Release --no-restore ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/Booking.Api.csproj
|
||||||
|
|
||||||
|
WORKDIR /3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api
|
||||||
|
|
||||||
|
# Publish project to output folder
|
||||||
|
# and no build, as we did it already
|
||||||
|
RUN dotnet publish -c Release --no-build -o out
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/out .
|
||||||
|
|
||||||
|
ENV ASPNETCORE_URLS https://*:443, http://*:80
|
||||||
|
ENV ASPNETCORE_ENVIRONMENT docker
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "Booking.Api.dll"]
|
||||||
|
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS builder
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
COPY ./.editorconfig ./
|
||||||
|
COPY ./global.json ./
|
||||||
|
COPY ./Directory.Build.props ./
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
COPY ./BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking/Booking.csproj ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/Booking.Api.csproj ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/
|
||||||
|
|
||||||
|
|
||||||
|
# Restore nuget packages
|
||||||
|
RUN --mount=type=cache,id=booking_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet restore ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/Booking.Api.csproj
|
||||||
|
|
||||||
|
# Copy project files
|
||||||
|
COPY ./BuildingBlocks ./BuildingBlocks/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking/ ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/ ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/
|
||||||
|
|
||||||
|
# Build project with Release configuration
|
||||||
|
# and no restore, as we did it already
|
||||||
|
|
||||||
|
RUN ls
|
||||||
|
RUN --mount=type=cache,id=booking_nuget,target=/root/.nuget/packages\
|
||||||
|
dotnet build -c Release --no-restore ./3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/Booking.Api.csproj
|
||||||
|
|
||||||
|
WORKDIR /3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api
|
||||||
|
|
||||||
|
# Publish project to output folder
|
||||||
|
# and no build, as we did it already
|
||||||
|
RUN --mount=type=cache,id=booking_nuget,target=/root/.nuget/packages\
|
||||||
|
dotnet publish -c Release --no-build -o out
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /3-Microservices-Architecture-Style/src/Services/Booking/src/Booking.Api/out .
|
||||||
|
|
||||||
|
ENV ASPNETCORE_URLS https://*:443, http://*:80
|
||||||
|
ENV ASPNETCORE_ENVIRONMENT docker
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "Booking.Api.dll"]
|
||||||
|
|
||||||
@ -1,7 +1,5 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Booking\Booking.csproj" />
|
<ProjectReference Include="..\Booking\Booking.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@ -1,9 +1,5 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\..\BuildingBlocks\BuildingBlocks.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Grpc.Tools" Version="2.68.1">
|
<PackageReference Include="Grpc.Tools" Version="2.68.1">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
@ -23,4 +19,8 @@
|
|||||||
</AssemblyAttribute>
|
</AssemblyAttribute>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\..\..\..\..\BuildingBlocks\BuildingBlocks.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS builder
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
COPY ./.editorconfig ./
|
||||||
|
COPY ./global.json ./
|
||||||
|
COPY ./Directory.Build.props ./
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
COPY ./BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight/Flight.csproj ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/Flight.Api.csproj ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/
|
||||||
|
|
||||||
|
|
||||||
|
# Restore nuget packages
|
||||||
|
RUN dotnet restore ./Services/Flight/src/Flight.Api/Flight.Api.csproj
|
||||||
|
|
||||||
|
# Copy project files
|
||||||
|
COPY ./BuildingBlocks ./BuildingBlocks/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight/ ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/ ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/
|
||||||
|
|
||||||
|
# Build project with Release configuration
|
||||||
|
# and no restore, as we did it already
|
||||||
|
|
||||||
|
RUN ls
|
||||||
|
RUN dotnet build -c Release --no-restore ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/Flight.Api.csproj
|
||||||
|
|
||||||
|
WORKDIR /3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api
|
||||||
|
|
||||||
|
# Publish project to output folder
|
||||||
|
# and no build, as we did it already
|
||||||
|
RUN dotnet publish -c Release --no-build -o out
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/out .
|
||||||
|
|
||||||
|
|
||||||
|
ENV ASPNETCORE_URLS https://*:443, http://*:80
|
||||||
|
ENV ASPNETCORE_ENVIRONMENT docker
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "Flight.Api.dll"]
|
||||||
|
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS builder
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
COPY ./.editorconfig ./
|
||||||
|
COPY ./global.json ./
|
||||||
|
COPY ./Directory.Build.props ./
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
COPY ./BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight/Flight.csproj ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/Flight.Api.csproj ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/
|
||||||
|
|
||||||
|
|
||||||
|
# Restore nuget packages
|
||||||
|
RUN --mount=type=cache,id=flight_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet restore ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/Flight.Api.csproj
|
||||||
|
|
||||||
|
# Copy project files
|
||||||
|
COPY ./BuildingBlocks ./BuildingBlocks/
|
||||||
|
COPY ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight/ ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight/
|
||||||
|
COPY .3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/ ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/
|
||||||
|
|
||||||
|
# Build project with Release configuration
|
||||||
|
# and no restore, as we did it already
|
||||||
|
|
||||||
|
RUN ls
|
||||||
|
RUN --mount=type=cache,id=flight_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet build -c Release --no-restore ./3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/Flight.Api.csproj
|
||||||
|
|
||||||
|
WORKDIR /3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api
|
||||||
|
|
||||||
|
# Publish project to output folder
|
||||||
|
# and no build, as we did it already
|
||||||
|
RUN --mount=type=cache,id=flight_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet publish -c Release --no-build -o out
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /3-Microservices-Architecture-Style/src/Services/Flight/src/Flight.Api/out .
|
||||||
|
|
||||||
|
|
||||||
|
ENV ASPNETCORE_URLS https://*:443, http://*:80
|
||||||
|
ENV ASPNETCORE_ENVIRONMENT docker
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "Flight.Api.dll"]
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user