【调整】将 Luban.Server的 Docker 相关脚本移到Scripts目录。新增 Luban.Client 项目的docker脚本

main
walon 2020-11-29 17:44:11 +08:00
parent 3e61051247
commit 334506ea96
5 changed files with 37 additions and 4 deletions

View File

@ -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"]

View File

@ -0,0 +1,2 @@
docker build -t luban.server:latest -f Dockerfile ../..
pause

View File

@ -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 ./

View File

@ -0,0 +1,2 @@
docker build -t luban.server:latest -f Dockerfile ../..
pause

View File

@ -1,2 +0,0 @@
docker build -t luban.server:latest -f Dockerfile ..
pause