Minor dockerfile fix.
All checks were successful
ci / build-test (push) Has been skipped
ci / publish-image (push) Successful in 7m55s

This commit is contained in:
2025-11-02 22:47:41 -05:00
parent d9a62a6fbd
commit 0399d5b761

View File

@@ -2,18 +2,18 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy solution + project files first (better layer caching)
# copy solution + project files first (for caching)
COPY JSMR.sln ./
COPY JSMR/JSMR.Api/JSMR.Api.csproj JSMR/JSMR.Api/
COPY JSMR/JSMR.Application/JSMR.Application.csproj JSMR/JSMR.Application/
COPY JSMR/JSMR.Domain/JSMR.Domain.csproj JSMR/JSMR.Domain/
COPY JSMR/JSMR.Infrastructure/JSMR.Infrastructure.csproj JSMR/JSMR.Infrastructure/
COPY JSMR.Api/JSMR.Api.csproj JSMR.Api/
COPY JSMR.Application/JSMR.Application.csproj JSMR.Application/
COPY JSMR.Domain/JSMR.Domain.csproj JSMR.Domain/
COPY JSMR.Infrastructure/JSMR.Infrastructure.csproj JSMR.Infrastructure/
RUN dotnet restore JSMR/JSMR.Api/JSMR.Api.csproj
RUN dotnet restore JSMR.Api/JSMR.Api.csproj
# Copy the rest of the source and publish
COPY JSMR/ ./JSMR/
RUN dotnet publish JSMR/JSMR.Api/JSMR.Api.csproj -c Release -o /app/publish --no-restore
# now copy the rest and publish
COPY . .
RUN dotnet publish JSMR.Api/JSMR.Api.csproj -c Release -o /app/publish --no-restore
# --- Runtime stage ---
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime