-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (45 loc) · 1.4 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS abstraction
WORKDIR /robin/Robin.Abstractions
COPY ./Robin.Abstractions/Robin.Abstractions.csproj ./
RUN dotnet restore
COPY ./Robin.Abstractions ./
RUN dotnet build -c Release
FROM abstraction AS build-impl
WORKDIR /robin/Implementations
COPY ./Implementations ./
RUN for impl in */; do \
cd $impl; \
dotnet publish -c Release -o /out/Implementations/$impl || exit 1; \
cd -; \
done
FROM abstraction AS build-mid
WORKDIR /robin/Middlewares
COPY ./Middlewares ./
RUN for mid in */; do \
cd $mid; \
dotnet publish -c Release -o /out/Middlewares/$mid || exit 1; \
cd -; \
done
FROM build-mid AS build-ext
WORKDIR /robin/Extensions
COPY ./Extensions ./
RUN for ext in */; do \
cd $ext; \
dotnet publish -c Release -o /out/Extensions/$ext || exit 1; \
cd -; \
done
FROM build-mid AS build-app
WORKDIR /robin/Robin.App
COPY ./Robin.App/Robin.App.csproj ./
RUN dotnet restore
COPY ./Robin.App ./
RUN dotnet publish -c Release -o /out/Robin.App
FROM mcr.microsoft.com/dotnet/runtime:9.0 AS final
RUN apt-get update && apt-get install -y fontconfig
WORKDIR /app
COPY --from=build-app /out/Robin.App .
COPY --from=build-impl /out/Implementations ./Implementations
COPY --from=build-ext /out/Extensions ./Extensions
RUN for f in $(ls *.dll); do rm -f /app/Extensions/*/$(basename $f); done
WORKDIR /app/data
ENTRYPOINT ["/app/Robin.App"]