MireaBackend/Dockerfile

28 lines
893 B
Docker
Raw Normal View History

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
2024-07-02 23:24:00 +03:00
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/*
2024-10-25 02:37:28 +03:00
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 . .
2024-07-02 23:24:00 +03:00
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
2024-07-05 02:28:18 +03:00
RUN dotnet publish ./Endpoint/Endpoint.csproj -c Release --self-contained false -p:PublishSingleFile=false -o /app
FROM base AS final
WORKDIR /app
2024-07-02 23:24:00 +03:00
COPY --from=build /app .
2024-07-05 02:28:18 +03:00
RUN find . -name "*.pdb" -type f -delete
2024-07-03 10:10:58 +03:00
ENTRYPOINT ["dotnet", "Mirea.Api.Endpoint.dll"]