# Front end (Linux container): ASP.NET Core web app on port 8080
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY TasksWeb.csproj .
RUN dotnet restore
COPY . .
RUN dotnet publish -c Release -o /out --no-restore

FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
ENV BACKEND_URL=http://backend:8080
COPY --from=build /out .
USER $APP_UID
EXPOSE 8080
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 CMD ["dotnet", "TasksWeb.dll", "--health"]
ENTRYPOINT ["dotnet", "TasksWeb.dll"]
