PalacePal/Dockerfile
2023-07-30 21:49:14 +02:00

30 lines
845 B
Docker

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-preview AS build-env
ARG TARGETARCH
WORKDIR /build
COPY Pal.Common/Pal.Common.csproj Pal.Common/
COPY Pal.Server/Pal.Server.csproj Pal.Server/
RUN dotnet restore Pal.Server/Pal.Server.csproj -a $TARGETARCH
COPY . ./
RUN dotnet publish Pal.Server/Pal.Server.csproj -a $TARGETARCH --no-restore -o /dist
FROM mcr.microsoft.com/dotnet/aspnet:8.0-preview
# fix later
ENV DOTNET_ROLL_FORWARD=Major
ENV DOTNET_ROLL_FORWARD_PRE_RELEASE=1
EXPOSE 5415
ENV DOTNET_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=
ENV DataDirectory=/data
ENV UseForwardedIp=true
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
ENTRYPOINT ["dotnet", "Pal.Server.dll"]