FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
ARG TARGETARCH
WORKDIR /source
COPY RhSolutions.SkuParser.Api/*.csproj .
RUN dotnet restore -a $TARGETARCH
COPY RhSolutions.SkuParser.Api/. .
RUN dotnet publish -a $TARGETARCH --no-restore -o /app
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
EXPOSE 8080
ENV \
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
LC_ALL=ru_RU.UTF-8 \
LANG=ru_RU.UTF-8
RUN apk add --no-cache \
icu-data-full \
icu-libs
WORKDIR /app
COPY --from=build /app .
USER $APP_UID
ENTRYPOINT ["./RhSolutions.SkuParser.Api"]