2024-11-17 10:31:01 +01:00
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
|
|
|
USER $APP_UID
|
|
|
|
WORKDIR /app
|
|
|
|
EXPOSE 8080
|
|
|
|
EXPOSE 8081
|
|
|
|
|
2024-11-17 12:59:08 +01:00
|
|
|
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
|
|
ARG TARGETARCH
|
|
|
|
ARG BUILDPLATFORM
|
2024-11-17 10:31:01 +01:00
|
|
|
ARG BUILD_CONFIGURATION=Release
|
2024-11-17 12:59:08 +01:00
|
|
|
|
2024-11-17 10:31:01 +01:00
|
|
|
WORKDIR /src
|
2024-11-17 12:59:08 +01:00
|
|
|
|
|
|
|
COPY ["Galaeth.ApiServer/Galaeth.ApiServer.csproj", "Galaeth.ApiServer/"]
|
|
|
|
COPY ["Galaeth.Core/Galaeth.Core.csproj", "Galaeth.Core/"]
|
|
|
|
COPY ["Galaeth.Services/Galaeth.Services.csproj", "Galaeth.Services/"]
|
|
|
|
COPY ["Galaeth.DAL/Galaeth.DAL.csproj", "Galaeth.DAL/"]
|
|
|
|
|
|
|
|
RUN dotnet restore "Galaeth.ApiServer/Galaeth.ApiServer.csproj"
|
2024-11-17 10:31:01 +01:00
|
|
|
COPY . .
|
2024-11-17 12:59:08 +01:00
|
|
|
WORKDIR "/src/Galaeth.ApiServer"
|
|
|
|
RUN dotnet build "Galaeth.ApiServer.csproj" -c $BUILD_CONFIGURATION -a $TARGETARCH -o /app/build
|
2024-11-17 10:31:01 +01:00
|
|
|
|
|
|
|
FROM build AS publish
|
2024-11-17 12:59:08 +01:00
|
|
|
ARG TARGETARCH
|
2024-11-17 10:31:01 +01:00
|
|
|
ARG BUILD_CONFIGURATION=Release
|
2024-11-17 12:59:08 +01:00
|
|
|
|
|
|
|
RUN dotnet publish "Galaeth.ApiServer.csproj" --no-restore -c $BUILD_CONFIGURATION -a $TARGETARCH -o /app/publish /p:UseAppHost=false
|
2024-11-17 10:31:01 +01:00
|
|
|
|
|
|
|
FROM base AS final
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=publish /app/publish .
|
2024-11-17 12:59:08 +01:00
|
|
|
ENTRYPOINT ["dotnet", "Galaeth.ApiServer.dll"]
|