Fixed dockerfile.
This commit is contained in:
@@ -2,23 +2,23 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# copy solution + restore-friendly files first for better layer caching
|
# Copy solution + project files first (better layer caching)
|
||||||
COPY JSMR.sln ./
|
COPY JSMR.sln ./
|
||||||
COPY src/JSMR.Api/JSMR.Api.csproj src/JSMR.Api/
|
COPY JSMR/JSMR.Api/JSMR.Api.csproj JSMR/JSMR.Api/
|
||||||
COPY src/JSMR.Application/JSMR.Application.csproj src/JSMR.Application/
|
COPY JSMR/JSMR.Application/JSMR.Application.csproj JSMR/JSMR.Application/
|
||||||
COPY src/JSMR.Domain/JSMR.Domain.csproj src/JSMR.Domain/
|
COPY JSMR/JSMR.Domain/JSMR.Domain.csproj JSMR/JSMR.Domain/
|
||||||
COPY src/JSMR.Infrastructure/JSMR.Infrastructure.csproj src/JSMR.Infrastructure/
|
COPY JSMR/JSMR.Infrastructure/JSMR.Infrastructure.csproj JSMR/JSMR.Infrastructure/
|
||||||
RUN dotnet restore src/JSMR.Api/JSMR.Api.csproj
|
|
||||||
|
|
||||||
# now copy the rest and publish
|
RUN dotnet restore JSMR/JSMR.Api/JSMR.Api.csproj
|
||||||
COPY src/ ./src/
|
|
||||||
RUN dotnet publish src/JSMR.Api/JSMR.Api.csproj -c Release -o /app/publish --no-restore
|
# 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
|
||||||
|
|
||||||
# --- Runtime stage ---
|
# --- Runtime stage ---
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/publish ./
|
COPY --from=build /app/publish ./
|
||||||
# optional: set ASPNETCORE_URLS to port 8080
|
|
||||||
ENV ASPNETCORE_URLS=http://+:8080
|
ENV ASPNETCORE_URLS=http://+:8080
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
ENTRYPOINT ["dotnet", "JSMR.Api.dll"]
|
ENTRYPOINT ["dotnet", "JSMR.Api.dll"]
|
||||||
|
|||||||
Reference in New Issue
Block a user