FROM mcr.microsoft.com/dotnet/sdk:8.0
WORKDIR /app

# Add `contrib` archive area to package sources list
RUN sed -i 's/^Components: main$/& contrib/' /etc/apt/sources.list.d/debian.sources

# Download the package lists from the repositories
# and install two packages `fontconfig` and `ttf-mscorefonts-installer`
RUN apt update && apt install -y \
    fontconfig \
    ttf-mscorefonts-installer 

# Copy the application and restore packages
COPY . .
RUN dotnet restore 

# Run the application
ENTRYPOINT ["dotnet", "run"]