40 lines
1.6 KiB
Text
40 lines
1.6 KiB
Text
# ==============================================================================
|
|
# TheCr3w-dev — Dockerfile Backend (.NET 10 ASP.NET Core)
|
|
# ==============================================================================
|
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
|
|
WORKDIR /src
|
|
|
|
COPY TheCr3w.slnx ./
|
|
COPY backend/TheCr3w.Shared/TheCr3w.Shared.csproj backend/TheCr3w.Shared/
|
|
COPY backend/NativeUpdate.Api/NativeUpdate.Api.csproj backend/NativeUpdate.Api/
|
|
COPY backend/DeploymentControl.Api/DeploymentControl.Api.csproj backend/DeploymentControl.Api/
|
|
COPY deployment/agent/TheCr3w.DeploymentAgent/TheCr3w.DeploymentAgent.csproj deployment/agent/TheCr3w.DeploymentAgent/
|
|
COPY sdk/windows/TheCr3w.WindowsUpdate.Sdk/TheCr3w.WindowsUpdate.Sdk.csproj sdk/windows/TheCr3w.WindowsUpdate.Sdk/
|
|
COPY tests/TheCr3w.Tests/TheCr3w.Tests.csproj tests/TheCr3w.Tests/
|
|
|
|
RUN dotnet restore TheCr3w.slnx
|
|
|
|
COPY . .
|
|
WORKDIR /src/backend/NativeUpdate.Api
|
|
RUN dotnet publish -c Release -o /app/publish --no-restore
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Runtime Image
|
|
# ------------------------------------------------------------------------------
|
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS runtime
|
|
WORKDIR /app
|
|
|
|
RUN addgroup -S thecr3w && adduser -S thecr3w -G thecr3w
|
|
USER thecr3w
|
|
|
|
COPY --from=build --chown=thecr3w:thecr3w /app/publish .
|
|
|
|
ENV ASPNETCORE_URLS=http://+:5000
|
|
EXPOSE 5000
|
|
|
|
HEALTHCHECK --interval=10s --timeout=5s --retries=3 \
|
|
CMD wget -qO- http://localhost:5000/health || exit 1
|
|
|
|
ENTRYPOINT ["dotnet", "NativeUpdate.Api.dll"]
|
|
|