Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions deployments/docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ services:
args:
Version: "1"
context: ../../
dockerfile: src/ApiGateway/dev.Dockerfile
dockerfile: src/ApiGateway/Dockerfile
container_name: api-gateway
ports:
- "5001:80"
Expand All @@ -382,7 +382,7 @@ services:
args:
Version: "1"
context: ../../
dockerfile: src/Services/Flight/dev.Dockerfile
dockerfile: src/Services/Flight/Dockerfile
container_name: flight
ports:
- 5004:80
Expand All @@ -408,7 +408,7 @@ services:
args:
Version: "1"
context: ../../
dockerfile: src/Services/Identity/dev.Dockerfile
dockerfile: src/Services/Identity/Dockerfile
container_name: identity
ports:
- 6005:80
Expand All @@ -435,7 +435,7 @@ services:
args:
Version: "1"
context: ../../
dockerfile: src/Services/Passenger/dev.Dockerfile
dockerfile: src/Services/Passenger/Dockerfile
container_name: passenger
ports:
- 6012:80
Expand All @@ -462,7 +462,7 @@ services:
args:
Version: "1"
context: ../../
dockerfile: src/Services/Booking/dev.Dockerfile
dockerfile: src/Services/Booking/Dockerfile
container_name: booking
ports:
- 6010:80
Expand Down
62 changes: 27 additions & 35 deletions src/ApiGateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS builder
WORKDIR /
# ---------- Build Stage ----------
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src

COPY ./.editorconfig ./
COPY ./global.json ./
COPY ./Directory.Build.props ./
# Copy solution-level files
COPY .editorconfig .
COPY global.json .
COPY Directory.Build.props .

# Setup working directory for the project
COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./building-blocks/
COPY ./src/ApiGateway/src/ApiGateway.csproj ./src/ApiGateway/src/
COPY ./src/Aspire/src/ServiceDefaults/ServiceDefaults.csproj ./src/Aspire/src/ServiceDefaults/
# Copy project files first (better Docker caching)
COPY src/BuildingBlocks/BuildingBlocks.csproj src/BuildingBlocks/
COPY src/ApiGateway/src/ApiGateway.csproj src/ApiGateway/src/
COPY src/Aspire/src/ServiceDefaults/ServiceDefaults.csproj src/Aspire/src/ServiceDefaults/

# Restore nuget packages
RUN dotnet restore ./src/ApiGateway/src/ApiGateway.csproj
# Restore dependencies
RUN dotnet restore src/ApiGateway/src/ApiGateway.csproj

# Copy project files
COPY ./src/BuildingBlocks ./src/BuildingBlocks/
COPY ./src/ApiGateway/src ./src/ApiGateway/src/
COPY ./src/Aspire/src/ServiceDefaults/ ./src/Aspire/src/ServiceDefaults/
# Copy the rest of the source code
COPY src ./src

# Build project with Release configuration
# and no restore, as we did it already
# Publish (build included)
RUN dotnet publish src/ApiGateway/src/ApiGateway.csproj \
-c Release \
-o /app/publish \
--no-restore

RUN ls
RUN dotnet build -c Release --no-restore ./src/ApiGateway/src/ApiGateway.csproj
# ---------- Runtime Stage ----------
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app

WORKDIR /src/ApiGateway/src
COPY --from=build /app/publish .

# 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:10.0

# Setup working directory for the project
WORKDIR /
COPY --from=builder /src/ApiGateway/src/out .

ENV ASPNETCORE_URLS https://*:443, http://*:80
ENV ASPNETCORE_ENVIRONMENT docker
ENV ASPNETCORE_URLS=http://+:80
ENV ASPNETCORE_ENVIRONMENT=docker

EXPOSE 80
EXPOSE 443

ENTRYPOINT ["dotnet", "ApiGateway.dll"]

ENTRYPOINT ["dotnet", "ApiGateway.dll"]
48 changes: 0 additions & 48 deletions src/ApiGateway/dev.Dockerfile

This file was deleted.

65 changes: 28 additions & 37 deletions src/Services/Booking/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,48 +1,39 @@
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS builder
WORKDIR /
# ---------- Build Stage ----------
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src

COPY ./.editorconfig ./
COPY ./global.json ./
COPY ./Directory.Build.props ./
# Copy solution-level files
COPY .editorconfig .
COPY global.json .
COPY Directory.Build.props .

# Setup working directory for the project
COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./src/BuildingBlocks/
COPY ./src/Services/Booking/src/Booking/Booking.csproj ./src/Services/Booking/src/Booking/
COPY ./src/Services/Booking/src/Booking.Api/Booking.Api.csproj ./src/Services/Booking/src/Booking.Api/
COPY ./src/Aspire/src/ServiceDefaults/ServiceDefaults.csproj ./src/Aspire/src/ServiceDefaults/
# Copy project files first (for Docker layer caching)
COPY src/BuildingBlocks/BuildingBlocks.csproj src/BuildingBlocks/
COPY src/Services/Booking/src/Booking/Booking.csproj src/Services/Booking/src/Booking/
COPY src/Services/Booking/src/Booking.Api/Booking.Api.csproj src/Services/Booking/src/Booking.Api/
COPY src/Aspire/src/ServiceDefaults/ServiceDefaults.csproj src/Aspire/src/ServiceDefaults/

# Restore nuget packages
RUN dotnet restore ./src/Services/Booking/src/Booking.Api/Booking.Api.csproj
# Restore dependencies
RUN dotnet restore src/Services/Booking/src/Booking.Api/Booking.Api.csproj

# Copy project files
COPY ./src/BuildingBlocks ./src/BuildingBlocks/
COPY ./src/Services/Booking/src/Booking/ ./src/Services/Booking/src/Booking/
COPY ./src/Services/Booking/src/Booking.Api/ ./src/Services/Booking/src/Booking.Api/
COPY ./src/Aspire/src/ServiceDefaults/ ./src/Aspire/src/ServiceDefaults/
# Copy the rest of the source
COPY src ./src

# Build project with Release configuration
# and no restore, as we did it already
# Publish (build included)
RUN dotnet publish src/Services/Booking/src/Booking.Api/Booking.Api.csproj \
-c Release \
-o /app/publish \
--no-restore

RUN ls
RUN dotnet build -c Release --no-restore ./src/Services/Booking/src/Booking.Api/Booking.Api.csproj
# ---------- Runtime Stage ----------
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app

WORKDIR /src/Services/Booking/src/Booking.Api
COPY --from=build /app/publish .

# 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:10.0

# Setup working directory for the project
WORKDIR /
COPY --from=builder /src/Services/Booking/src/Booking.Api/out .

ENV ASPNETCORE_URLS https://*:443, http://*:80
ENV ASPNETCORE_ENVIRONMENT docker
ENV ASPNETCORE_URLS=http://+:80
ENV ASPNETCORE_ENVIRONMENT=docker

EXPOSE 80
EXPOSE 443

ENTRYPOINT ["dotnet", "Booking.Api.dll"]

ENTRYPOINT ["dotnet", "Booking.Api.dll"]
51 changes: 0 additions & 51 deletions src/Services/Booking/dev.Dockerfile

This file was deleted.

66 changes: 28 additions & 38 deletions src/Services/Flight/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,49 +1,39 @@
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS builder
WORKDIR /
# ---------- Build Stage ----------
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src

COPY ./.editorconfig ./
COPY ./global.json ./
COPY ./Directory.Build.props ./
# Copy solution-level files
COPY .editorconfig .
COPY global.json .
COPY Directory.Build.props .

# Setup working directory for the project
COPY ./src/BuildingBlocks/BuildingBlocks.csproj ./src/BuildingBlocks/
COPY ./src/Services/Flight/src/Flight/Flight.csproj ./src/Services/Flight/src/Flight/
COPY ./src/Services/Flight/src/Flight.Api/Flight.Api.csproj ./src/Services/Flight/src/Flight.Api/
COPY ./src/Aspire/src/ServiceDefaults/ServiceDefaults.csproj ./src/Aspire/src/ServiceDefaults/
# Copy project files first (better layer caching)
COPY src/BuildingBlocks/BuildingBlocks.csproj src/BuildingBlocks/
COPY src/Services/Flight/src/Flight/Flight.csproj src/Services/Flight/src/Flight/
COPY src/Services/Flight/src/Flight.Api/Flight.Api.csproj src/Services/Flight/src/Flight.Api/
COPY src/Aspire/src/ServiceDefaults/ServiceDefaults.csproj src/Aspire/src/ServiceDefaults/

# Restore nuget packages
RUN dotnet restore ./src/Services/Flight/src/Flight.Api/Flight.Api.csproj
# Restore dependencies
RUN dotnet restore src/Services/Flight/src/Flight.Api/Flight.Api.csproj

# Copy project files
COPY ./src/BuildingBlocks ./src/BuildingBlocks/
COPY ./src/Services/Flight/src/Flight/ ./src/Services/Flight/src/Flight/
COPY ./src/Services/Flight/src/Flight.Api/ ./src/Services/Flight/src/Flight.Api/
COPY ./src/Aspire/src/ServiceDefaults/ ./src/Aspire/src/ServiceDefaults/
# Copy remaining source code
COPY src ./src

# Build project with Release configuration
# and no restore, as we did it already
# Publish (build included)
RUN dotnet publish src/Services/Flight/src/Flight.Api/Flight.Api.csproj \
-c Release \
-o /app/publish \
--no-restore

RUN ls
RUN dotnet build -c Release --no-restore ./src/Services/Flight/src/Flight.Api/Flight.Api.csproj
# ---------- Runtime Stage ----------
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app

WORKDIR /src/Services/Flight/src/Flight.Api
COPY --from=build /app/publish .

# 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:10.0

# Setup working directory for the project
WORKDIR /
COPY --from=builder /src/Services/Flight/src/Flight.Api/out .


ENV ASPNETCORE_URLS https://*:443, http://*:80
ENV ASPNETCORE_ENVIRONMENT docker
ENV ASPNETCORE_URLS=http://+:80
ENV ASPNETCORE_ENVIRONMENT=docker

EXPOSE 80
EXPOSE 443

ENTRYPOINT ["dotnet", "Flight.Api.dll"]

ENTRYPOINT ["dotnet", "Flight.Api.dll"]
Loading
Loading