Files
MireaBackend/Dockerfile
Polianin Nikita 92e07790cc
All checks were successful
Build and Deploy Docker Container / build-and-deploy (push) Successful in 4m33s
build: add support .net 10
2025-11-23 13:24:48 +03:00

36 lines
993 B
Docker

FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
LABEL company="Winsomnia"
LABEL maintainer.name="Wesser" maintainer.email="support@winsomnia.net"
WORKDIR /app
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl --fail http://localhost:8080/health || exit 1
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY . .
ARG NUGET_USERNAME
ARG NUGET_PASSWORD
ARG NUGET_ADDRESS
RUN dotnet nuget add source ${NUGET_ADDRESS} \
--name Winsomnia \
--username ${NUGET_USERNAME} \
--password ${NUGET_PASSWORD} \
--store-password-in-clear-text
RUN dotnet restore ./Backend.sln
RUN dotnet publish Endpoint/Endpoint.csproj \
-c Release \
--self-contained false \
-p:PublishSingleFile=false \
-o /app
FROM base AS final
WORKDIR /app
COPY --from=build /app .
RUN find . -name "*.pdb" -type f -delete
ENTRYPOINT ["dotnet", "Mirea.Api.Endpoint.dll"]