-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
55 lines (47 loc) · 1.93 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
51
52
53
54
55
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app
# EXPOSE 8010
# ENV ASPNETCORE_URLS=http://+:8010
#
# copy csproj and restore as distinct layers
COPY *.sln .
COPY Json/Burst/*.csproj ./Json/Burst/
COPY Json/Fliox/*.csproj ./Json/Fliox/
COPY Json/Fliox.Annotation/*.csproj ./Json/Fliox.Annotation/
COPY Json/Fliox.Hub/*.csproj ./Json/Fliox.Hub/
COPY Json/Fliox.Hub.AspNetCore/*.csproj ./Json/Fliox.Hub.AspNetCore/
COPY Json/Fliox.Hub.Explorer/*.csproj ./Json/Fliox.Hub.Explorer/
COPY Json/Fliox.Hub.GraphQL/*.csproj ./Json/Fliox.Hub.GraphQL/
COPY Demos~/Demo/Client/*.csproj ./Demos~/Demo/Client/
COPY Demos~/Demo/Hub/*.csproj ./Demos~/Demo/Hub/
#
RUN dotnet restore Demos~/Demo/Hub/DemoHub.csproj
#
# copy everything else and build app
COPY Json/Burst/. ./Json/Burst/
COPY Json/Fliox/. ./Json/Fliox/
COPY Json/Fliox.Annotation/. ./Json/Fliox.Annotation/
COPY Json/Fliox.Hub/. ./Json/Fliox.Hub/
COPY Json/Fliox.Hub.AspNetCore/. ./Json/Fliox.Hub.AspNetCore/
COPY Json/Fliox.Hub.Explorer/. ./Json/Fliox.Hub.Explorer/
COPY Json/Fliox.Hub.GraphQL/. ./Json/Fliox.Hub.GraphQL/
COPY Demos~/Demo/Client/. ./Demos~/Demo/Client/
COPY Demos~/Demo/Hub/. ./Demos~/Demo/Hub/
COPY Demos~/Demo/Test/. ./Demos~/Demo/Test/
#
WORKDIR /app/Demos~/Demo/Hub/
RUN dotnet publish DemoHub.csproj -c Release -o out
#
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime
# copy test databases: main_db & user_db
COPY --from=build /app/Demos~/Demo/Test/DB /Test/DB
WORKDIR /app
#
COPY --from=build /app/Demos~/Demo/Hub/out ./
WORKDIR /app
#
COPY --from=build /app/Demos~/Demo/Hub/out ./
ENTRYPOINT ["dotnet", "DemoHub.dll"]
# --- usage
# docker build -t demo-hub:latest .
# docker run -it --rm -p 80:8010 demo-hub:latest