mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-29 01:04:56 +08:00
chore: Update Dockerfiles
This commit is contained in:
parent
a142a2e789
commit
a70320b705
@ -133,7 +133,7 @@ services:
|
|||||||
args:
|
args:
|
||||||
Version: "1"
|
Version: "1"
|
||||||
context: ../../
|
context: ../../
|
||||||
dockerfile: src/ApiGateway/Dockerfile
|
dockerfile: src/ApiGateway/dev.Dockerfile
|
||||||
container_name: gateway
|
container_name: gateway
|
||||||
ports:
|
ports:
|
||||||
- "5001:80"
|
- "5001:80"
|
||||||
@ -160,7 +160,7 @@ services:
|
|||||||
args:
|
args:
|
||||||
Version: "1"
|
Version: "1"
|
||||||
context: ../../
|
context: ../../
|
||||||
dockerfile: src/Services/Flight/Dockerfile
|
dockerfile: src/Services/Flight/dev.Dockerfile
|
||||||
container_name: flight
|
container_name: flight
|
||||||
ports:
|
ports:
|
||||||
- 5004:80
|
- 5004:80
|
||||||
@ -186,7 +186,7 @@ services:
|
|||||||
args:
|
args:
|
||||||
Version: "1"
|
Version: "1"
|
||||||
context: ../../
|
context: ../../
|
||||||
dockerfile: src/Services/Identity/Dockerfile
|
dockerfile: src/Services/Identity/dev.Dockerfile
|
||||||
container_name: identity
|
container_name: identity
|
||||||
ports:
|
ports:
|
||||||
- 6005:80
|
- 6005:80
|
||||||
@ -213,7 +213,7 @@ services:
|
|||||||
args:
|
args:
|
||||||
Version: "1"
|
Version: "1"
|
||||||
context: ../../
|
context: ../../
|
||||||
dockerfile: src/Services/Passenger/Dockerfile
|
dockerfile: src/Services/Passenger/dev.Dockerfile
|
||||||
container_name: passenger
|
container_name: passenger
|
||||||
ports:
|
ports:
|
||||||
- 6012:80
|
- 6012:80
|
||||||
@ -240,7 +240,7 @@ services:
|
|||||||
args:
|
args:
|
||||||
Version: "1"
|
Version: "1"
|
||||||
context: ../../
|
context: ../../
|
||||||
dockerfile: src/Services/Booking/Dockerfile
|
dockerfile: src/Services/Booking/dev.Dockerfile
|
||||||
container_name: booking
|
container_name: booking
|
||||||
ports:
|
ports:
|
||||||
- 6010:80
|
- 6010:80
|
||||||
|
|||||||
@ -8,8 +8,7 @@ COPY ./src/ApiGateway/src/ApiGateway.csproj ./ApiGateway/src/
|
|||||||
|
|
||||||
|
|
||||||
# Restore nuget packages
|
# Restore nuget packages
|
||||||
RUN --mount=type=cache,id=gateway_nuget,target=/root/.nuget/packages \
|
RUN dotnet restore ./ApiGateway/src/ApiGateway.csproj
|
||||||
dotnet restore ./ApiGateway/src/ApiGateway.csproj
|
|
||||||
|
|
||||||
# Copy project files
|
# Copy project files
|
||||||
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
||||||
@ -19,15 +18,13 @@ COPY ./src/ApiGateway/src ./ApiGateway/src/
|
|||||||
# 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 dotnet build -c Release --no-restore ./ApiGateway/src/ApiGateway.csproj
|
||||||
dotnet build -c Release --no-restore ./ApiGateway/src/ApiGateway.csproj
|
|
||||||
|
|
||||||
WORKDIR /src/ApiGateway/src
|
WORKDIR /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
|
||||||
RUN --mount=type=cache,id=gateway_nuget,target=/root/.nuget/packages \
|
RUN dotnet publish -c Release --no-build -o out
|
||||||
dotnet publish -c Release --no-build -o out
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||||
|
|
||||||
|
|||||||
45
src/ApiGateway/dev.Dockerfile
Normal file
45
src/ApiGateway/dev.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./BuildingBlocks/
|
||||||
|
COPY ./src/ApiGateway/src/ApiGateway.csproj ./ApiGateway/src/
|
||||||
|
|
||||||
|
|
||||||
|
# Restore nuget packages
|
||||||
|
RUN --mount=type=cache,id=gateway_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet restore ./ApiGateway/src/ApiGateway.csproj
|
||||||
|
|
||||||
|
# Copy project files
|
||||||
|
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
||||||
|
COPY ./src/ApiGateway/src ./ApiGateway/src/
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Publish project to output folder
|
||||||
|
# and no build, as we did it already
|
||||||
|
RUN --mount=type=cache,id=gateway_nuget,target=/root/.nuget/packages \
|
||||||
|
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 /src/ApiGateway/src/out .
|
||||||
|
|
||||||
|
ENV ASPNETCORE_URLS https://*:443, http://*:80
|
||||||
|
ENV ASPNETCORE_ENVIRONMENT docker
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "ApiGateway.dll"]
|
||||||
|
|
||||||
@ -1,27 +1,46 @@
|
|||||||
{
|
{
|
||||||
|
"LogOptions": {
|
||||||
|
"Level": "Information",
|
||||||
|
"LogTemplate": "{Timestamp:HH:mm:ss} [{Level:u4}] {Message:lj}{NewLine}{Exception}",
|
||||||
|
"ElasticUri": "elasticsearch:9200"
|
||||||
|
},
|
||||||
"Yarp": {
|
"Yarp": {
|
||||||
"clusters": {
|
"clusters": {
|
||||||
"flight": {
|
"flight": {
|
||||||
"destinations": {
|
"destinations": {
|
||||||
"destination1": {
|
"destination1": {
|
||||||
"address": "http://flight"
|
"address": "http://flight:80"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"identity": {
|
||||||
|
"destinations": {
|
||||||
|
"destination1": {
|
||||||
|
"address": "http://identity:80"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"passenger": {
|
"passenger": {
|
||||||
"destinations": {
|
"destinations": {
|
||||||
"destination1": {
|
"destination1": {
|
||||||
"address": "http://passenger"
|
"address": "http://passenger:80"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"booking": {
|
"booking": {
|
||||||
"destinations": {
|
"destinations": {
|
||||||
"destination1": {
|
"destination1": {
|
||||||
"address": "http://booking"
|
"address": "http://booking:80"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"Jwt": {
|
||||||
|
"Jwt": {
|
||||||
|
"Authority": "http://identity:80",
|
||||||
|
"RequireHttpsMetadata": false,
|
||||||
|
"MetadataAddress": "http://identity:80/.well-known/openid-configuration"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,7 +69,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Authority": "https://localhost:5005"
|
"Jwt": {
|
||||||
|
"Authority": "http://localhost:6005",
|
||||||
|
"RequireHttpsMetadata": false,
|
||||||
|
"MetadataAddress": "http://localhost:6005/.well-known/openid-configuration"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*"
|
"AllowedHosts": "*"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,8 +8,7 @@ COPY ./src/Services/Booking/src/Booking.Api/Booking.Api.csproj ./Services/Bookin
|
|||||||
|
|
||||||
|
|
||||||
# Restore nuget packages
|
# Restore nuget packages
|
||||||
RUN --mount=type=cache,id=booking_nuget,target=/root/.nuget/packages \
|
RUN dotnet restore ./Services/Booking/src/Booking.Api/Booking.Api.csproj
|
||||||
dotnet restore ./Services/Booking/src/Booking.Api/Booking.Api.csproj
|
|
||||||
|
|
||||||
# Copy project files
|
# Copy project files
|
||||||
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
||||||
@ -20,15 +19,13 @@ COPY ./src/Services/Booking/src/Booking.Api/ ./Services/Booking/src/Booking.Api
|
|||||||
# 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=booking_nuget,target=/root/.nuget/packages\
|
RUN dotnet build -c Release --no-restore ./Services/Booking/src/Booking.Api/Booking.Api.csproj
|
||||||
dotnet build -c Release --no-restore ./Services/Booking/src/Booking.Api/Booking.Api.csproj
|
|
||||||
|
|
||||||
WORKDIR /Services/Booking/src/Booking.Api
|
WORKDIR /Services/Booking/src/Booking.Api
|
||||||
|
|
||||||
# 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
|
||||||
RUN --mount=type=cache,id=booking_nuget,target=/root/.nuget/packages\
|
RUN dotnet publish -c Release --no-build -o out
|
||||||
dotnet publish -c Release --no-build -o out
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||||
|
|
||||||
|
|||||||
46
src/Services/Booking/dev.Dockerfile
Normal file
46
src/Services/Booking/dev.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
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/
|
||||||
|
|
||||||
|
|
||||||
|
# Restore nuget packages
|
||||||
|
RUN --mount=type=cache,id=booking_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet restore ./Services/Booking/src/Booking.Api/Booking.Api.csproj
|
||||||
|
|
||||||
|
# Copy project files
|
||||||
|
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/
|
||||||
|
|
||||||
|
# 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 ./Services/Booking/src/Booking.Api/Booking.Api.csproj
|
||||||
|
|
||||||
|
WORKDIR /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:7.0
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /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"]
|
||||||
|
|
||||||
@ -26,10 +26,10 @@
|
|||||||
"Port": 5672
|
"Port": 5672
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Authority": "http://host.docker.internal:6005",
|
"Authority": "http://identity:80",
|
||||||
"Audience": "booking-api",
|
"Audience": "booking-api",
|
||||||
"RequireHttpsMetadata": false,
|
"RequireHttpsMetadata": false,
|
||||||
"MetadataAddress": "http://host.docker.internal:6005/.well-known/openid-configuration"
|
"MetadataAddress": "http://identity:80/.well-known/openid-configuration"
|
||||||
},
|
},
|
||||||
"Grpc": {
|
"Grpc": {
|
||||||
"FlightAddress": "flight:5003",
|
"FlightAddress": "flight:5003",
|
||||||
|
|||||||
@ -22,9 +22,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Authority": "https://localhost:5005",
|
"Authority": "http://localhost:6005",
|
||||||
"Audience": "booking-api",
|
"Audience": "booking-api",
|
||||||
"RequireHttpsMetadata": true
|
"RequireHttpsMetadata": false,
|
||||||
|
"MetadataAddress": "http://localhost:6005/.well-known/openid-configuration"
|
||||||
},
|
},
|
||||||
"RabbitMqOptions": {
|
"RabbitMqOptions": {
|
||||||
"HostName": "localhost",
|
"HostName": "localhost",
|
||||||
|
|||||||
@ -8,8 +8,7 @@ COPY ./src/Services/Flight/src/Flight.Api/Flight.Api.csproj ./Services/Flight/sr
|
|||||||
|
|
||||||
|
|
||||||
# Restore nuget packages
|
# Restore nuget packages
|
||||||
RUN --mount=type=cache,id=flight_nuget,target=/root/.nuget/packages \
|
RUN dotnet restore ./Services/Flight/src/Flight.Api/Flight.Api.csproj
|
||||||
dotnet restore ./Services/Flight/src/Flight.Api/Flight.Api.csproj
|
|
||||||
|
|
||||||
# Copy project files
|
# Copy project files
|
||||||
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
||||||
@ -20,15 +19,13 @@ COPY ./src/Services/Flight/src/Flight.Api/ ./Services/Flight/src/Flight.Api/
|
|||||||
# 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=flight_nuget,target=/root/.nuget/packages \
|
RUN dotnet build -c Release --no-restore ./Services/Flight/src/Flight.Api/Flight.Api.csproj
|
||||||
dotnet build -c Release --no-restore ./Services/Flight/src/Flight.Api/Flight.Api.csproj
|
|
||||||
|
|
||||||
WORKDIR /Services/Flight/src/Flight.Api
|
WORKDIR /Services/Flight/src/Flight.Api
|
||||||
|
|
||||||
# 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
|
||||||
RUN --mount=type=cache,id=flight_nuget,target=/root/.nuget/packages \
|
RUN dotnet publish -c Release --no-build -o out
|
||||||
dotnet publish -c Release --no-build -o out
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||||
|
|
||||||
|
|||||||
47
src/Services/Flight/dev.Dockerfile
Normal file
47
src/Services/Flight/dev.Dockerfile
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
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/
|
||||||
|
|
||||||
|
|
||||||
|
# Restore nuget packages
|
||||||
|
RUN --mount=type=cache,id=flight_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet restore ./Services/Flight/src/Flight.Api/Flight.Api.csproj
|
||||||
|
|
||||||
|
# Copy project files
|
||||||
|
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/
|
||||||
|
|
||||||
|
# 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 ./Services/Flight/src/Flight.Api/Flight.Api.csproj
|
||||||
|
|
||||||
|
WORKDIR /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:7.0
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /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"]
|
||||||
|
|
||||||
@ -23,10 +23,10 @@
|
|||||||
"ConnectionString": "Server=postgres;Port=5432;Database=flight;User Id=postgres;Password=postgres;Include Error Detail=true"
|
"ConnectionString": "Server=postgres;Port=5432;Database=flight;User Id=postgres;Password=postgres;Include Error Detail=true"
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Authority": "http://host.docker.internal:6005",
|
"Authority": "http://identity:80",
|
||||||
"Audience": "flight-api",
|
"Audience": "flight-api",
|
||||||
"RequireHttpsMetadata": false,
|
"RequireHttpsMetadata": false,
|
||||||
"MetadataAddress": "http://host.docker.internal:6005/.well-known/openid-configuration"
|
"MetadataAddress": "http://identity:80/.well-known/openid-configuration"
|
||||||
},
|
},
|
||||||
"RabbitMqOptions": {
|
"RabbitMqOptions": {
|
||||||
"HostName": "rabbitmq",
|
"HostName": "rabbitmq",
|
||||||
|
|||||||
@ -7,8 +7,7 @@ COPY ./src/Services/Identity/src/Identity/Identity.csproj ./Services/Identity/sr
|
|||||||
COPY ./src/Services/Identity/src/Identity.Api/Identity.Api.csproj ./Services/Identity/src/Identity.Api/
|
COPY ./src/Services/Identity/src/Identity.Api/Identity.Api.csproj ./Services/Identity/src/Identity.Api/
|
||||||
|
|
||||||
# Restore nuget packages
|
# Restore nuget packages
|
||||||
RUN --mount=type=cache,id=identity_nuget,target=/root/.nuget/packages \
|
RUN dotnet restore ./Services/Identity/src/Identity.Api/Identity.Api.csproj
|
||||||
dotnet restore ./Services/Identity/src/Identity.Api/Identity.Api.csproj
|
|
||||||
|
|
||||||
# Copy project files
|
# Copy project files
|
||||||
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
||||||
@ -19,15 +18,13 @@ COPY ./src/Services/Identity/src/Identity.Api/ ./Services/Identity/src/Identity
|
|||||||
# 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=identity_nuget,target=/root/.nuget/packages \
|
RUN dotnet build -c Release --no-restore ./Services/Identity/src/Identity.Api/Identity.Api.csproj
|
||||||
dotnet build -c Release --no-restore ./Services/Identity/src/Identity.Api/Identity.Api.csproj
|
|
||||||
|
|
||||||
WORKDIR /Services/Identity/src/Identity.Api
|
WORKDIR /Services/Identity/src/Identity.Api
|
||||||
|
|
||||||
# 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
|
||||||
RUN --mount=type=cache,id=identity_nuget,target=/root/.nuget/packages \
|
RUN dotnet publish -c Release --no-build -o out
|
||||||
dotnet publish -c Release --no-build -o out
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||||
|
|
||||||
|
|||||||
45
src/Services/Identity/dev.Dockerfile
Normal file
45
src/Services/Identity/dev.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
WORKDIR /
|
||||||
|
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/
|
||||||
|
|
||||||
|
# Restore nuget packages
|
||||||
|
RUN --mount=type=cache,id=identity_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet restore ./Services/Identity/src/Identity.Api/Identity.Api.csproj
|
||||||
|
|
||||||
|
# Copy project files
|
||||||
|
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/
|
||||||
|
|
||||||
|
# Build project with Release configuration
|
||||||
|
# and no restore, as we did it already
|
||||||
|
|
||||||
|
RUN ls
|
||||||
|
RUN --mount=type=cache,id=identity_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet build -c Release --no-restore ./Services/Identity/src/Identity.Api/Identity.Api.csproj
|
||||||
|
|
||||||
|
WORKDIR /Services/Identity/src/Identity.Api
|
||||||
|
|
||||||
|
# Publish project to output folder
|
||||||
|
# and no build, as we did it already
|
||||||
|
RUN --mount=type=cache,id=identity_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet publish -c Release --no-build -o out
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /Services/Identity/src/Identity.Api/out .
|
||||||
|
|
||||||
|
ENV ASPNETCORE_URLS https://*:443, http://*:80
|
||||||
|
ENV ASPNETCORE_ENVIRONMENT docker
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "Identity.Api.dll"]
|
||||||
|
|
||||||
@ -9,7 +9,7 @@
|
|||||||
"ConnectionString": "Server=postgres;Port=5432;Database=persist_message;User Id=postgres;Password=postgres;Include Error Detail=true"
|
"ConnectionString": "Server=postgres;Port=5432;Database=persist_message;User Id=postgres;Password=postgres;Include Error Detail=true"
|
||||||
},
|
},
|
||||||
"AuthOptions": {
|
"AuthOptions": {
|
||||||
"IssuerUri": "http://host.docker.internal:6005"
|
"IssuerUri": "http://identity:80"
|
||||||
},
|
},
|
||||||
"RabbitMqOptions": {
|
"RabbitMqOptions": {
|
||||||
"HostName": "rabbitmq",
|
"HostName": "rabbitmq",
|
||||||
|
|||||||
@ -8,8 +8,7 @@ COPY ./src/Services/Passenger/src/Passenger.Api/Passenger.Api.csproj ./Services/
|
|||||||
|
|
||||||
|
|
||||||
# Restore nuget packages
|
# Restore nuget packages
|
||||||
RUN --mount=type=cache,id=passenger_nuget,target=/root/.nuget/packages \
|
RUN dotnet restore ./Services/Passenger/src/Passenger.Api/Passenger.Api.csproj
|
||||||
dotnet restore ./Services/Passenger/src/Passenger.Api/Passenger.Api.csproj
|
|
||||||
|
|
||||||
# Copy project files
|
# Copy project files
|
||||||
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
COPY ./src/BuildingBlocks ./BuildingBlocks/
|
||||||
@ -20,15 +19,13 @@ COPY ./src/Services/Passenger/src/Passenger.Api/ ./Services/Passenger/src/Passe
|
|||||||
# 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=passenger_nuget,target=/root/.nuget/packages \
|
RUN dotnet build -c Release --no-restore ./Services/Passenger/src/Passenger.Api/Passenger.Api.csproj
|
||||||
dotnet build -c Release --no-restore ./Services/Passenger/src/Passenger.Api/Passenger.Api.csproj
|
|
||||||
|
|
||||||
WORKDIR /Services/Passenger/src/Passenger.Api
|
WORKDIR /Services/Passenger/src/Passenger.Api
|
||||||
|
|
||||||
# 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
|
||||||
RUN --mount=type=cache,id=passenger_nuget,target=/root/.nuget/packages \
|
RUN dotnet publish -c Release --no-build -o out
|
||||||
dotnet publish -c Release --no-build -o out
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||||
|
|
||||||
|
|||||||
46
src/Services/Passenger/dev.Dockerfile
Normal file
46
src/Services/Passenger/dev.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
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/
|
||||||
|
|
||||||
|
|
||||||
|
# Restore nuget packages
|
||||||
|
RUN --mount=type=cache,id=passenger_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet restore ./Services/Passenger/src/Passenger.Api/Passenger.Api.csproj
|
||||||
|
|
||||||
|
# Copy project files
|
||||||
|
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/
|
||||||
|
|
||||||
|
# Build project with Release configuration
|
||||||
|
# and no restore, as we did it already
|
||||||
|
|
||||||
|
RUN ls
|
||||||
|
RUN --mount=type=cache,id=passenger_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet build -c Release --no-restore ./Services/Passenger/src/Passenger.Api/Passenger.Api.csproj
|
||||||
|
|
||||||
|
WORKDIR /Services/Passenger/src/Passenger.Api
|
||||||
|
|
||||||
|
# Publish project to output folder
|
||||||
|
# and no build, as we did it already
|
||||||
|
RUN --mount=type=cache,id=passenger_nuget,target=/root/.nuget/packages \
|
||||||
|
dotnet publish -c Release --no-build -o out
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||||
|
|
||||||
|
# Setup working directory for the project
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /Services/Passenger/src/Passenger.Api/out .
|
||||||
|
|
||||||
|
ENV ASPNETCORE_URLS https://*:443, http://*:80
|
||||||
|
ENV ASPNETCORE_ENVIRONMENT docker
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 443
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "Passenger.Api.dll"]
|
||||||
|
|
||||||
@ -9,10 +9,10 @@
|
|||||||
"ConnectionString": "Server=postgres;Port=5432;Database=persist_message;User Id=postgres;Password=postgres;Include Error Detail=true"
|
"ConnectionString": "Server=postgres;Port=5432;Database=persist_message;User Id=postgres;Password=postgres;Include Error Detail=true"
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Authority": "http://host.docker.internal:6005",
|
"Authority": "http://identity:80",
|
||||||
"Audience": "passenger-api",
|
"Audience": "passenger-api",
|
||||||
"RequireHttpsMetadata": false,
|
"RequireHttpsMetadata": false,
|
||||||
"MetadataAddress": "http://host.docker.internal:6005/.well-known/openid-configuration"
|
"MetadataAddress": "http://identity:80/.well-known/openid-configuration"
|
||||||
},
|
},
|
||||||
"MongoOptions": {
|
"MongoOptions": {
|
||||||
"ConnectionString": "mongodb://mongo:27017",
|
"ConnectionString": "mongodb://mongo:27017",
|
||||||
|
|||||||
@ -10,9 +10,10 @@
|
|||||||
"DatabaseName": "passenger-db"
|
"DatabaseName": "passenger-db"
|
||||||
},
|
},
|
||||||
"Jwt": {
|
"Jwt": {
|
||||||
"Authority": "https://localhost:5005",
|
"Authority": "http://localhost:6005",
|
||||||
"Audience": "passenger-api",
|
"Audience": "passenger-api",
|
||||||
"RequireHttpsMetadata": "true"
|
"RequireHttpsMetadata": false,
|
||||||
|
"MetadataAddress": "http://localhost:6005/.well-known/openid-configuration"
|
||||||
},
|
},
|
||||||
"RabbitMqOptions": {
|
"RabbitMqOptions": {
|
||||||
"HostName": "localhost",
|
"HostName": "localhost",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user