From afab1906d1fcf5ecabed10744a216c7f3f4acd83 Mon Sep 17 00:00:00 2001 From: meysamhadeli Date: Tue, 14 Feb 2023 05:16:52 +0330 Subject: [PATCH] chore: Update identity server --- .github/actions/docker-build-publish/action.yml | 4 ++-- src/Services/Booking/Dockerfile | 11 +++++------ src/Services/Flight/Dockerfile | 9 ++++----- src/Services/Identity/Dockerfile | 10 +++++----- .../Identity/src/Identity.Api/appsettings.docker.json | 2 +- src/Services/Passenger/Dockerfile | 11 +++++------ 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/.github/actions/docker-build-publish/action.yml b/.github/actions/docker-build-publish/action.yml index a83f08f..771636f 100644 --- a/.github/actions/docker-build-publish/action.yml +++ b/.github/actions/docker-build-publish/action.yml @@ -43,11 +43,11 @@ runs: if: ${{ github.ref == 'refs/heads/main' && success() }} shell: bash run: | - docker build -t ${{ inputs.registry-username }}/${{ inputs.image-name }}:v1.5.7 -f "${{ github.workspace }}/${{ inputs.dockerfile-path }}" . + docker build -t ${{ inputs.registry-username }}/${{ inputs.image-name }}:v1.5.8 -f "${{ github.workspace }}/${{ inputs.dockerfile-path }}" . - name: Publish Docker Image if: ${{ github.ref == 'refs/heads/main' && success() }} shell: bash run: | - docker push ${{ inputs.registry-username }}/${{ inputs.image-name }}:v1.5.7 + docker push ${{ inputs.registry-username }}/${{ inputs.image-name }}:v1.5.8 diff --git a/src/Services/Booking/Dockerfile b/src/Services/Booking/Dockerfile index 952b9b6..b4e2bbf 100644 --- a/src/Services/Booking/Dockerfile +++ b/src/Services/Booking/Dockerfile @@ -1,8 +1,7 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder -WORKDIR /app +WORKDIR / # Setup working directory for the project -WORKDIR /app COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/Services/Booking/src/Booking/Booking.csproj ./Services/Booking/src/Booking/ COPY ./src/Services/Booking/src/Booking.Api/Booking.Api.csproj ./Services/Booking/src/Booking.Api/ @@ -22,7 +21,7 @@ COPY ./src/Services/Booking/src/Booking.Api/ ./Services/Booking/src/Booking.Api RUN ls RUN dotnet build -c Release --no-restore ./Services/Booking/src/Booking.Api/Booking.Api.csproj -WORKDIR /app/Services/Booking/src/Booking.Api +WORKDIR /Services/Booking/src/Booking.Api # Publish project to output folder # and no build, as we did it already @@ -31,11 +30,11 @@ RUN dotnet publish -c Release --no-build -o out FROM mcr.microsoft.com/dotnet/aspnet:7.0 # Setup working directory for the project -WORKDIR /app -COPY --from=builder /app/Services/Booking/src/Booking.Api/out . +WORKDIR / +COPY --from=builder /Services/Booking/src/Booking.Api/out . ENV ASPNETCORE_URLS https://*:5010, http://*:6010 -ENV ASPNETCORE_ENVIRONMENT docker +ENV ASPNETCORE_ENVIRONMENT docker ENTRYPOINT ["dotnet", "Booking.Api.dll"] diff --git a/src/Services/Flight/Dockerfile b/src/Services/Flight/Dockerfile index c70b002..4068ddb 100644 --- a/src/Services/Flight/Dockerfile +++ b/src/Services/Flight/Dockerfile @@ -1,8 +1,7 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder -WORKDIR /app +WORKDIR / # Setup working directory for the project -WORKDIR /app COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/Services/Flight/src/Flight/Flight.csproj ./Services/Flight/src/Flight/ COPY ./src/Services/Flight/src/Flight.Api/Flight.Api.csproj ./Services/Flight/src/Flight.Api/ @@ -22,7 +21,7 @@ COPY ./src/Services/Flight/src/Flight.Api/ ./Services/Flight/src/Flight.Api/ RUN ls RUN dotnet build -c Release --no-restore ./Services/Flight/src/Flight.Api/Flight.Api.csproj -WORKDIR /app/Services/Flight/src/Flight.Api +WORKDIR /Services/Flight/src/Flight.Api # Publish project to output folder # and no build, as we did it already @@ -31,8 +30,8 @@ RUN dotnet publish -c Release --no-build -o out FROM mcr.microsoft.com/dotnet/aspnet:7.0 # Setup working directory for the project -WORKDIR /app -COPY --from=builder /app/Services/Flight/src/Flight.Api/out . +WORKDIR / +COPY --from=builder /Services/Flight/src/Flight.Api/out . ENV ASPNETCORE_URLS https://*:5003,http://*:5004 diff --git a/src/Services/Identity/Dockerfile b/src/Services/Identity/Dockerfile index 6e23e94..8aaf3a7 100644 --- a/src/Services/Identity/Dockerfile +++ b/src/Services/Identity/Dockerfile @@ -1,8 +1,8 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder -WORKDIR /app # Setup working directory for the project -WORKDIR /app +WORKDIR / +COPY ./src/Services/Identity/cert/localhost.pfx ./localhost.pfx 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/ @@ -22,7 +22,7 @@ COPY ./src/Services/Identity/src/Identity.Api/ ./Services/Identity/src/Identity RUN ls RUN dotnet build -c Release --no-restore ./Services/Identity/src/Identity.Api/Identity.Api.csproj -WORKDIR /app/Services/Identity/src/Identity.Api +WORKDIR /Services/Identity/src/Identity.Api # Publish project to output folder # and no build, as we did it already @@ -31,8 +31,8 @@ RUN dotnet publish -c Release --no-build -o out FROM mcr.microsoft.com/dotnet/aspnet:7.0 # Setup working directory for the project -WORKDIR /app -COPY --from=builder /app/Services/Identity/src/Identity.Api/out . +WORKDIR / +COPY --from=builder /Services/Identity/src/Identity.Api/out . ENV ASPNETCORE_URLS https://*:5005, http://*:6005 ENV ASPNETCORE_ENVIRONMENT docker diff --git a/src/Services/Identity/src/Identity.Api/appsettings.docker.json b/src/Services/Identity/src/Identity.Api/appsettings.docker.json index 6da3cbc..1b0b22b 100644 --- a/src/Services/Identity/src/Identity.Api/appsettings.docker.json +++ b/src/Services/Identity/src/Identity.Api/appsettings.docker.json @@ -36,7 +36,7 @@ "Kestrel": { "Certificates": { "Default": { - "Path": "/etc/ssl/certs/localhost.pfx", + "Path": "./localhost.pfx", "Password": "000000" } } diff --git a/src/Services/Passenger/Dockerfile b/src/Services/Passenger/Dockerfile index 8631203..aedfd29 100644 --- a/src/Services/Passenger/Dockerfile +++ b/src/Services/Passenger/Dockerfile @@ -1,8 +1,7 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder -WORKDIR /app +WORKDIR / # Setup working directory for the project -WORKDIR /app COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/ COPY ./src/Services/Passenger/src/Passenger/Passenger.csproj ./Services/Passenger/src/Passenger/ COPY ./src/Services/Passenger/src/Passenger.Api/Passenger.Api.csproj ./Services/Passenger/src/Passenger.Api/ @@ -22,7 +21,7 @@ COPY ./src/Services/Passenger/src/Passenger.Api/ ./Services/Passenger/src/Passe RUN ls RUN dotnet build -c Release --no-restore ./Services/Passenger/src/Passenger.Api/Passenger.Api.csproj -WORKDIR /app/Services/Passenger/src/Passenger.Api +WORKDIR /Services/Passenger/src/Passenger.Api # Publish project to output folder # and no build, as we did it already @@ -31,11 +30,11 @@ RUN dotnet publish -c Release --no-build -o out FROM mcr.microsoft.com/dotnet/aspnet:7.0 # Setup working directory for the project -WORKDIR /app -COPY --from=builder /app/Services/Passenger/src/Passenger.Api/out . +WORKDIR / +COPY --from=builder /Services/Passenger/src/Passenger.Api/out . ENV ASPNETCORE_URLS https://*:5012, http://*:6012 -ENV ASPNETCORE_ENVIRONMENT docker +ENV ASPNETCORE_ENVIRONMENT docker ENTRYPOINT ["dotnet", "Passenger.Api.dll"]