diff --git a/src/Luban.Client/Scripts/Dockerfile b/src/Luban.Client/Scripts/Dockerfile new file mode 100644 index 0000000..3516f7f --- /dev/null +++ b/src/Luban.Client/Scripts/Dockerfile @@ -0,0 +1,21 @@ +FROM mcr.microsoft.com/dotnet/sdk:5.0 as build + +WORKDIR /app/Luban.Common +COPY Luban.Common/*.csproj ./ +COPY Luban.Common/Source ./Source +COPY Luban.Common/.editorconfig . +COPY nuget.config ./nuget.config + +WORKDIR /app/Luban.Client +COPY Luban.Client/Luban.Client.csproj ./ +COPY Luban.Client/.editorconfig . +COPY Luban.Client/Source ./Source +COPY nuget.config ./nuget.config + +RUN dotnet publish -c Release -o out + +FROM mcr.microsoft.com/dotnet/runtime:5.0 AS runtime +WORKDIR /app +COPY --from=build /app/Luban.Client/out ./ + +ENTRYPOINT ["/app/Luban.Client"] \ No newline at end of file diff --git a/src/Luban.Client/Scripts/build_docker.bat b/src/Luban.Client/Scripts/build_docker.bat new file mode 100644 index 0000000..08fe29a --- /dev/null +++ b/src/Luban.Client/Scripts/build_docker.bat @@ -0,0 +1,2 @@ +docker build -t luban.server:latest -f Dockerfile ../.. +pause \ No newline at end of file diff --git a/src/Luban.Server/Dockerfile b/src/Luban.Server/Scripts/Dockerfile similarity index 70% rename from src/Luban.Server/Dockerfile rename to src/Luban.Server/Scripts/Dockerfile index 73c8fdf..8305f9c 100644 --- a/src/Luban.Server/Dockerfile +++ b/src/Luban.Server/Scripts/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as build +FROM mcr.microsoft.com/dotnet/sdk:5.0 as build WORKDIR /app/Luban.Common COPY Luban.Common/*.csproj ./ @@ -21,6 +21,16 @@ COPY Luban.Job.Cfg/*.csproj ./ COPY Luban.Job.Cfg/Source ./Source COPY nuget.config ./nuget.config +WORKDIR /app/Luban.Job.Proto +COPY Luban.Job.Proto/*.csproj ./ +COPY Luban.Job.Proto/Source ./Source +COPY nuget.config ./nuget.config + +WORKDIR /app/Luban.Job.Db +COPY Luban.Job.Db/*.csproj ./ +COPY Luban.Job.Db/Source ./Source +COPY nuget.config ./nuget.config + WORKDIR /app/Luban.Server COPY Luban.Server/Luban.Server.csproj ./ COPY Luban.Server/.editorconfig . @@ -29,7 +39,7 @@ COPY nuget.config ./nuget.config RUN dotnet publish -c Release -o out -FROM mcr.microsoft.com/dotnet/core/runtime:3.1 AS runtime +FROM mcr.microsoft.com/dotnet/runtime:5.0 AS runtime RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone WORKDIR /app COPY --from=build /app/Luban.Server/out ./ diff --git a/src/Luban.Server/Scripts/build_docker.bat b/src/Luban.Server/Scripts/build_docker.bat new file mode 100644 index 0000000..08fe29a --- /dev/null +++ b/src/Luban.Server/Scripts/build_docker.bat @@ -0,0 +1,2 @@ +docker build -t luban.server:latest -f Dockerfile ../.. +pause \ No newline at end of file diff --git a/src/Luban.Server/build_docker.bat b/src/Luban.Server/build_docker.bat deleted file mode 100644 index 71ba5d9..0000000 --- a/src/Luban.Server/build_docker.bat +++ /dev/null @@ -1,2 +0,0 @@ -docker build -t luban.server:latest -f Dockerfile .. -pause \ No newline at end of file