From 7977e382d6e0458662c1d0065e00e00754ff1581 Mon Sep 17 00:00:00 2001 From: yubaolee Date: Sat, 7 Jun 2025 23:46:44 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A0=EF=B8=8Ffeat:=20=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E5=88=A0=E9=99=A4mvc=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 11 ++--------- OpenAuth.Mvc/appsettings.json | 25 ------------------------- 2 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 OpenAuth.Mvc/appsettings.json diff --git a/Dockerfile b/Dockerfile index d7caf014..06599916 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,6 @@ FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base WORKDIR /app # WebApi EXPOSE 52789 -# Mvc -EXPOSE 1802 # Identity EXPOSE 12796 @@ -12,7 +10,6 @@ WORKDIR /src # 将当前目录下的所有文件和文件夹复制到容器的当前工作目录中 COPY *.sln ./ COPY ["OpenAuth.WebApi/", "./OpenAuth.WebApi/"] -COPY ["OpenAuth.Mvc/", "./OpenAuth.Mvc/"] COPY ["OpenAuth.Identity/", "./OpenAuth.Identity/"] COPY ["Infrastructure/", "./Infrastructure/"] COPY ["OpenAuth.App/", "./OpenAuth.App/"] @@ -24,9 +21,6 @@ RUN dotnet restore OpenAuth.Net.sln WORKDIR "/src/OpenAuth.WebApi" RUN dotnet publish -c Release -o /app/publish/webapi -# 发布 Mvc -WORKDIR "/src/OpenAuth.Mvc" -RUN dotnet publish -c Release -o /app/publish/mvc # 发布 Identity WORKDIR "/src/OpenAuth.Identity" @@ -36,11 +30,10 @@ FROM base AS final WORKDIR /app # 复制 WebApi 发布文件 COPY --from=build /app/publish/webapi ./webapi -# 复制 Mvc 发布文件 -COPY --from=build /app/publish/mvc ./mvc + # 复制 Identity 发布文件 COPY --from=build /app/publish/identity ./identity # 启动 WebApi, Mvc, 和 Identity,就算失败也保持运行,方便查询日志 -ENTRYPOINT ["sh", "-c", "cd webapi && dotnet OpenAuth.WebApi.dll & cd mvc && dotnet OpenAuth.Mvc.dll & cd identity && dotnet OpenAuth.IdentityServer.dll || tail -f /dev/null"] +ENTRYPOINT ["sh", "-c", "cd webapi && dotnet OpenAuth.WebApi.dll & cd identity && dotnet OpenAuth.IdentityServer.dll || tail -f /dev/null"] diff --git a/OpenAuth.Mvc/appsettings.json b/OpenAuth.Mvc/appsettings.json deleted file mode 100644 index 29aad41a..00000000 --- a/OpenAuth.Mvc/appsettings.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Warning" - } - }, - "AllowedHosts": "*", - "DataProtection": "temp-keys/", - "ConnectionStrings": { - "OpenAuthDBContext": "Data Source=.;Encrypt=false;Initial Catalog=OpenAuthDB;User=sa;Password=000000" - //"OpenAuthDBContext": "server=127.0.0.1;user id=root;database=openauthdb;password=000000" //my sql - //"OpenAuthDBContext": "Host=localhost;Port=5432;Database=OpenAuth;Username=postgres;Password=123;" //PostgreSQL - }, - "AppSetting": { - //"IdentityServerUrl": "http://localhost:12796", //IdentityServer服务器地址。如果为空,则不启用OAuth认证 - "IdentityServerUrl": "", //IdentityServer服务器地址。如果为空,则不启用OAuth认证 - "SSOPassport": "http://localhost:52789", - "Version": "1.0", //如果为demo,则可以防止post提交 - "DbTypes": { - "OpenAuthDBContext": "SqlServer" //数据库类型:SqlServer、MySql、Oracle、PostgreSQL - }, - "RedisConf": "redistest.cq-p.com.cn:8001,password=share_redis@123", //redis配置 - "HttpHost": "http://*:1802" //启动绑定地址及端口 - } -}