PalacePal/Dockerfile

30 lines
845 B
Docker
Raw Permalink Normal View History

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/
COPY Pal.Server/Pal.Server.csproj Pal.Server/
2023-07-30 17:37:58 +00:00
RUN dotnet restore Pal.Server/Pal.Server.csproj -a $TARGETARCH
2023-02-09 21:07:09 +00:00
COPY . ./
2023-07-30 17:37:58 +00:00
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
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
ENTRYPOINT ["dotnet", "Pal.Server.dll"]