-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (51 loc) · 2.49 KB
/
Dockerfile
File metadata and controls
58 lines (51 loc) · 2.49 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build-base
COPY ./build.ps1 /robin/
WORKDIR /robin
FROM build-base AS abstraction
COPY ./Robin.Abstractions/*.csproj /robin/Robin.Abstractions/
RUN pwsh -Command ". ./build.ps1; Restore-Abstraction"
COPY ./Robin.Abstractions /robin/Robin.Abstractions
RUN pwsh -Command ". ./build.ps1; Build-Abstraction"
FROM abstraction AS build-impl
COPY ./Implementations/*/*.csproj /robin/Implementations/
RUN for file in $(ls /robin/Implementations/*.csproj); do \
mkdir -p Implementations/$(basename ${file%.*}) && mv $file Implementations/$(basename ${file%.*})/; \
done
RUN pwsh -Command ". ./build.ps1; Restore-Implementations"
COPY ./Implementations /robin/Implementations
RUN pwsh -Command ". ./build.ps1; Publish-Implementations"
FROM abstraction AS build-mid
COPY ./Middlewares/*/*.csproj /robin/Middlewares/
RUN for file in $(ls /robin/Middlewares/*.csproj); do \
mkdir -p Middlewares/$(basename ${file%.*}) && mv $file Middlewares/$(basename ${file%.*})/; \
done
RUN pwsh -Command ". ./build.ps1; Restore-Middlewares"
COPY ./Middlewares /robin/Middlewares
RUN pwsh -Command ". ./build.ps1; Publish-Middlewares"
FROM build-mid AS build-ext
COPY ./Extensions/*/*.csproj /robin/Extensions/
RUN for file in $(ls /robin/Extensions/*.csproj); do \
mkdir -p Extensions/$(basename ${file%.*}) && mv $file Extensions/$(basename ${file%.*})/; \
done
RUN pwsh -Command ". ./build.ps1; Restore-Extensions"
COPY ./Extensions /robin/Extensions
RUN pwsh -Command ". ./build.ps1; Publish-Extensions"
FROM abstraction AS build-app
COPY ./Robin.App/*.csproj /robin/Robin.App/
RUN pwsh -Command ". ./build.ps1; Restore-App"
COPY ./Robin.App /robin/Robin.App
RUN pwsh -Command ". ./build.ps1; Publish-App"
FROM build-base AS merge
COPY --from=build-app /robin/out/Robin.App /robin/out/Robin.App
COPY --from=build-impl /robin/out/Implementations /robin/out/Implementations
RUN pwsh -Command ". ./build.ps1; Remove-TransitiveDependencies -DirName Implementations"
COPY --from=build-mid /robin/out/Middlewares /robin/out/Middlewares
RUN pwsh -Command ". ./build.ps1; Remove-TransitiveDependencies -DirName Middlewares"
COPY --from=build-ext /robin/out/Extensions /robin/out/Extensions
RUN pwsh -Command ". ./build.ps1; Remove-TransitiveDependencies -DirName Extensions"
RUN pwsh -Command ". ./build.ps1; Build-FinalStructure"
FROM mcr.microsoft.com/dotnet/runtime:10.0 AS final
RUN apt-get update && apt-get install -y fontconfig
COPY --from=merge /robin/out /app
WORKDIR /app/data
ENTRYPOINT ["/app/Robin.App"]