Timothy Schenk
6d9a72ded4
Some checks failed
Build, Package and Push Images / preprocess (push) Successful in 2s
Build, Package and Push Images / build (push) Successful in 25s
Build, Package and Push Images / sbom-scan (push) Successful in 36s
Build, Package and Push Images / sonarqube (push) Failing after 1m36s
Build, Package and Push Images / container-build (push) Successful in 2m4s
Build, Package and Push Images / container-sbom-scan (push) Successful in 39s
27 lines
911 B
Docker
27 lines
911 B
Docker
FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine AS base
|
|
WORKDIR /app
|
|
|
|
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
|
|
ARG TARGETARCH
|
|
ENV TZ=Etc/UTC
|
|
ENV DOTNET_TieredPGO=1
|
|
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
|
|
|
|
RUN echo "Target: $TARGETARCH" && echo "Build: $BUILDPLATFORM"
|
|
WORKDIR /src
|
|
COPY ["Continuity.AuthServer/Continuity.AuthServer.csproj", "Continuity.AuthServer/"]
|
|
COPY ["Wonderking/Wonderking.csproj", "Wonderking/"]
|
|
RUN dotnet restore "Wonderking/Wonderking.csproj" -a $TARGETARCH && dotnet restore "Continuity.AuthServer/Continuity.AuthServer.csproj" -a $TARGETARCH
|
|
COPY . .
|
|
|
|
FROM build AS publish
|
|
RUN dotnet publish "Continuity.AuthServer/Continuity.AuthServer.csproj" -c Release -a $TARGETARCH --no-restore -f net8.0 -o /app
|
|
COPY ../config /app/config
|
|
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
COPY --from=publish /app .
|
|
USER $APP_UID
|
|
ENTRYPOINT ["./Continuity.AuthServer"]
|
|
|
|
|