-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.Alpine
42 lines (34 loc) · 1.33 KB
/
Dockerfile.Alpine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine AS base
#Install dependencies
RUN apk update && apk upgrade
RUN apk add icu-libs icu-data-full fontconfig
#Install fonts
RUN apk add ttf-dejavu && \
apk add msttcorefonts-installer && \
apk add ttf-dejavu && \
update-ms-fonts && \
fc-cache -f
WORKDIR /app
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 80
EXPOSE 443
FROM node:18 as build-frontend
WORKDIR /modules
COPY ["package.json", "./"]
RUN npm install
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
WORKDIR /src
RUN --mount=type=secret,id=dxnuget,required=true dotnet nuget add source $(cat /run/secrets/dxnuget) -n devexpress-nuget
COPY ["ReportingWebApp.csproj", "ReportingWebApp/"]
RUN dotnet restore "ReportingWebApp/ReportingWebApp.csproj"
COPY ["./", "ReportingWebApp/"]
WORKDIR "/src/ReportingWebApp"
COPY --from=build-frontend ./modules .
RUN dotnet build "ReportingWebApp.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "ReportingWebApp.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ReportingWebApp.dll"]