FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY global.json ./
COPY src/FrameProcessor/FrameProcessor.csproj src/FrameProcessor/
RUN dotnet restore src/FrameProcessor/FrameProcessor.csproj
COPY src/FrameProcessor/ src/FrameProcessor/
RUN dotnet publish src/FrameProcessor/FrameProcessor.csproj \
    -c Release \
    -o /app/publish

FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
#RUN addgroup --system --gid 1000 app \
# && adduser --system --uid 1000 --ingroup app --no-create-home app \
# && mkdir -p /data/images \
# && chown -R app:app /data
#COPY --from=build --chown=app:app /app/publish ./
COPY --from=build /app/publish ./
USER app
EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080
ENTRYPOINT ["dotnet", "FrameProcessor.dll"]
