2023-07-30 17:37:58 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-preview AS build-env
|
|
|
|
ARG TARGETARCH
|
2023-02-09 21:07:09 +00:00
|
|
|
WORKDIR /build
|
|
|
|
COPY Pal.Common/Pal.Common.csproj Pal.Common/
|
2023-11-11 00:54:43 +00:00
|
|
|
COPY Server/Server/Pal.Server.csproj Pal.Server/
|
|
|
|
RUN dotnet restore Server/Server/Pal.Server.csproj -a $TARGETARCH
|
2023-02-09 21:07:09 +00:00
|
|
|
|
|
|
|
COPY . ./
|
2023-11-11 00:54:43 +00:00
|
|
|
RUN dotnet publish Server/Server/Pal.Server.csproj -a $TARGETARCH --no-restore -o /dist
|
2023-07-30 17:37:58 +00:00
|
|
|
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0-preview
|
|
|
|
|
|
|
|
# fix later
|
|
|
|
ENV DOTNET_ROLL_FORWARD=Major
|
|
|
|
ENV DOTNET_ROLL_FORWARD_PRE_RELEASE=1
|
2023-02-09 21:07:09 +00:00
|
|
|
|
|
|
|
EXPOSE 5415
|
|
|
|
ENV DOTNET_ENVIRONMENT=Production
|
|
|
|
ENV ASPNETCORE_URLS=
|
2023-02-09 22:13:19 +00:00
|
|
|
ENV DataDirectory=/data
|
|
|
|
ENV UseForwardedIp=true
|
2023-02-09 21:07:09 +00:00
|
|
|
ENV Kestrel__Endpoints__Http2__Url=http://+:5415
|
|
|
|
|
|
|
|
RUN adduser --uid 2000 --disabled-password --group --no-create-home --quiet --system pal
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build-env /dist .
|
|
|
|
|
|
|
|
USER pal
|
2023-11-11 00:54:43 +00:00
|
|
|
ENTRYPOINT ["dotnet", "Pal.Server.dll"]
|