forked from rafaelfgx/Architecture
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
35 lines (29 loc) · 1.07 KB
/
dockerfile
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
# .NET SDK
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS dotnet
# Copy Projects
COPY source/Application/Architecture.Application.csproj ./source/Application/
COPY source/Database/Architecture.Database.csproj ./source/Database/
COPY source/Domain/Architecture.Domain.csproj ./source/Domain/
COPY source/Model/Architecture.Model.csproj ./source/Model/
COPY source/Web/Architecture.Web.csproj ./source/Web/
# .NET Restore
RUN dotnet restore ./source/Web/Architecture.Web.csproj
# Copy All Files
COPY source ./source/
# .NET Publish
RUN dotnet publish ./source/Web/Architecture.Web.csproj -c Release -o /dist --no-restore
# Angular
FROM node:16-alpine AS angular
WORKDIR ./source/Web/Frontend/
COPY source/Web/Frontend/package.json ./
RUN npm run restore
COPY source/Web/Frontend ./
RUN npm run publish
# .NET Runtime
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine
RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
WORKDIR /app
COPY --from=dotnet /dist .
COPY --from=angular /source/Web/Frontend/dist ./Frontend/dist
ENTRYPOINT ["dotnet", "Architecture.Web.dll"]