2023-11-14 21:38:43 +00:00
FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine AS base
2023-08-09 14:23:41 +00:00
WORKDIR /app
2023-11-14 21:38:43 +00:00
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
2023-10-27 17:47:17 +00:00
ARG TARGETARCH
ENV TZ=Etc/UTC
ENV DOTNET_TieredPGO=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
2023-11-16 17:48:29 +00:00
RUN echo "Target: $TARGETARCH" && echo "Build: $BUILDPLATFORM"
2023-08-09 14:23:41 +00:00
WORKDIR /src
2023-11-28 14:35:31 +00:00
COPY ["Continuity.AuthServer/Continuity.AuthServer.csproj", "Continuity.AuthServer/"]
2024-01-29 07:39:18 +00:00
COPY ["Wonderking/Wonderking.csproj", "Wonderking/"]
2024-02-05 17:12:12 +00:00
COPY ["Rai.PacketMediator/Rai.PacketMediator.csproj", "Rai.PacketMediator/"]
RUN dotnet restore "Wonderking/Wonderking.csproj" -a $TARGETARCH && dotnet restore "Rai.PacketMediator/Rai.PacketMediator.csproj" -a $TARGETARCH && dotnet restore "Continuity.AuthServer/Continuity.AuthServer.csproj" -a $TARGETARCH
2023-08-09 14:23:41 +00:00
COPY . .
FROM build AS publish
2023-11-28 14:35:31 +00:00
RUN dotnet publish "Continuity.AuthServer/Continuity.AuthServer.csproj" -c Release -a $TARGETARCH --no-restore -f net8.0 -o /app
2023-11-16 17:48:29 +00:00
COPY ../config /app/config
2023-08-09 14:23:41 +00:00
FROM base AS final
WORKDIR /app
2023-10-27 17:47:17 +00:00
COPY --from=publish /app .
USER $APP_UID
2023-11-28 14:35:31 +00:00
ENTRYPOINT ["./Continuity.AuthServer"]
2023-10-27 17:47:17 +00:00