Minor dockerfile fix.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user