# Stage 1: Build FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build WORKDIR /app # Copy the solution and all projects COPY GB5Shared/ GB5Shared/ COPY GB5Framework/ GB5Framework/ COPY GB5Solution/ GB5Solution/ # Install Aspire CLI (if not already installed) RUN dotnet workload install aspire # Restore dependencies RUN dotnet restore GB5Framework/GB5Framework.sln # Build all solutions RUN dotnet build GB5Framework/GB5Framework.sln -c Release --no-restore # Publish the FrameworkSL API RUN dotnet publish GB5Framework/FrameworkSL/FrameworkSL.csproj -c Release -o /out/FrameworkAPI --no-build # Stage 2: Runtime FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /app # Copy the published output from the build stage COPY --from=build /out/FrameworkAPI ./ # Expose API and Aspire Dashboard ports EXPOSE 5000 18888 18889 # Set environment variables for Aspire ENV ASPNETCORE_ENVIRONMENT=Development ENV DOTNET_USE_POLLING_FILE_WATCHER=1 ENV OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 ENV OTEL_SERVICE_NAME=GB5Service ENV OTEL_RESOURCE_ATTRIBUTES=service.name=GB5Service # Set the entrypoint script for the app ENTRYPOINT ["dotnet", "FrameworkSL.dll"]