MireaBackend/Dockerfile
Polianin Nikita ed99fce9b8
All checks were successful
.NET Test Pipeline / build-and-test (push) Successful in 2m13s
Build and Deploy Docker Container / build-and-deploy (push) Successful in 2m52s
build: fix unhealth
Signed-off-by: Polianin Nikita <wesser@noreply.git.winsomnia.net>
2024-10-25 09:38:28 +03:00

28 lines
893 B
Docker

FROM mcr.microsoft.com/dotnet/aspnet:8.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:8.0 AS build
WORKDIR /src
COPY . .
ARG NUGET_USERNAME
ARG NUGET_PASSWORD
ENV NUGET_USERNAME=$NUGET_USERNAME
ENV NUGET_PASSWORD=$NUGET_PASSWORD
RUN dotnet restore ./Backend.sln --configfile nuget.config
WORKDIR /app
WORKDIR /src
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"]