2023-04-16 17:59:59 +07:00
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
2023-04-21 10:45:52 +07:00
COPY Components ./Components
2023-04-22 11:43:16 +07:00
COPY nuget.config .
2023-04-21 10:45:52 +07:00
COPY ["BMA.EHR.Report.Service.csproj", "."]
RUN dotnet restore "./BMA.EHR.Report.Service.csproj"
2023-04-16 17:59:59 +07:00
COPY . .
2023-04-21 10:45:52 +07:00
WORKDIR "/src/."
2023-04-16 17:59:59 +07:00
RUN dotnet build "BMA.EHR.Report.Service.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "BMA.EHR.Report.Service.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
2023-04-22 11:43:16 +07:00
RUN apt-get update && apt-get -y install fontconfig && apt-get install -y --allow-unauthenticated libgdiplus libc6-dev
COPY ./Fonts/THSarabunIT.ttf /usr/share/fonts/truetype/
COPY ./Fonts/THSarabunITBold.ttf /usr/share/fonts/truetype/
COPY ./Fonts/THSarabunITItalic.ttf /usr/share/fonts/truetype/
COPY ./Fonts/THSarabunITBoldItalic.ttf /usr/share/fonts/truetype/
COPY ./Fonts/THSarabunNew.ttf /usr/share/fonts/truetype/
COPY ./Fonts/THSarabunNewBold.ttf /usr/share/fonts/truetype/
COPY ./Fonts/THSarabunNewItalic.ttf /usr/share/fonts/truetype/
COPY ./Fonts/THSarabunNewBoldItalic.ttf /usr/share/fonts/truetype/
RUN fc-cache -f -v
2023-04-16 17:59:59 +07:00
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "BMA.EHR.Report.Service.dll"]