15 lines
402 B
Docker
15 lines
402 B
Docker
# https://hub.docker.com/_/microsoft-dotnet
|
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
WORKDIR /source
|
|
|
|
# copy csproj and restore as distinct layers
|
|
COPY ./ ./
|
|
RUN dotnet restore
|
|
WORKDIR /source/SWAD.API
|
|
RUN dotnet publish -c release -o /app --no-restore
|
|
|
|
# final stage/image
|
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
|
WORKDIR /app
|
|
COPY --from=build /app ./
|
|
ENTRYPOINT ["dotnet", "/app/SWAD.API.dll"] |