diff --git a/src/NPin.Web/Dockerfile b/src/NPin.Web/Dockerfile index c52eb69..fa0ba49 100644 --- a/src/NPin.Web/Dockerfile +++ b/src/NPin.Web/Dockerfile @@ -1,47 +1,42 @@ -#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. - -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base -USER app -WORKDIR /app -EXPOSE 8080 - -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build -ARG BUILD_CONFIGURATION=Release -WORKDIR /src -COPY ["src/NPin.Web/NPin.Web.csproj", "src/NPin.Web/"] -COPY ["framework/NPin.Framework.AspNetCore.Authentication.OAuth/NPin.Framework.AspNetCore.Authentication.OAuth.csproj", "framework/NPin.Framework.AspNetCore.Authentication.OAuth/"] -COPY ["framework/NPin.Framework.AspNetCore/NPin.Framework.AspNetCore.csproj", "framework/NPin.Framework.AspNetCore/"] -COPY ["framework/NPin.Framework.Core/NPin.Framework.Core.csproj", "framework/NPin.Framework.Core/"] -COPY ["src/NPin.Application/NPin.Application.csproj", "src/NPin.Application/"] -COPY ["framework/NPin.Framework.Ddd.Application/NPin.Framework.Ddd.Application.csproj", "framework/NPin.Framework.Ddd.Application/"] -COPY ["framework/NPin.Framework.Ddd.Application.Contracts/NPin.Framework.Ddd.Application.Contracts.csproj", "framework/NPin.Framework.Ddd.Application.Contracts/"] -COPY ["module/bbs/NPin.Framework.Bbs.Application/NPin.Framework.Bbs.Application.csproj", "module/bbs/NPin.Framework.Bbs.Application/"] -COPY ["module/rbac/NPin.Framework.Rbac.Application/NPin.Framework.Rbac.Application.csproj", "module/rbac/NPin.Framework.Rbac.Application/"] -COPY ["module/rbac/NPin.Framework.Rbac.Application.Contracts/NPin.Framework.Rbac.Application.Contracts.csproj", "module/rbac/NPin.Framework.Rbac.Application.Contracts/"] -COPY ["module/rbac/NPin.Framework.Rbac.Domain.Shared/NPin.Framework.Rbac.Domain.Shared.csproj", "module/rbac/NPin.Framework.Rbac.Domain.Shared/"] -COPY ["framework/NPin.Framework.Mapster/NPin.Framework.Mapster.csproj", "framework/NPin.Framework.Mapster/"] -COPY ["framework/NPin.Framework.SqlSugarCore.Abstractions/NPin.Framework.SqlSugarCore.Abstractions.csproj", "framework/NPin.Framework.SqlSugarCore.Abstractions/"] -COPY ["module/rbac/NPin.Framework.Rbac.Domain/NPin.Framework.Rbac.Domain.csproj", "module/rbac/NPin.Framework.Rbac.Domain/"] -COPY ["module/bbs/NPin.Framework.Bbs.Application.Contracts/NPin.Framework.Bbs.Application.Contracts.csproj", "module/bbs/NPin.Framework.Bbs.Application.Contracts/"] -COPY ["module/bbs/NPin.Framework.Bbs.Domain.Shared/NPin.Framework.Bbs.Domain.Shared.csproj", "module/bbs/NPin.Framework.Bbs.Domain.Shared/"] -COPY ["module/bbs/NPin.Framework.Bbs.Domain/NPin.Framework.Bbs.Domain.csproj", "module/bbs/NPin.Framework.Bbs.Domain/"] -COPY ["src/NPin.Application.Contracts/NPin.Application.Contracts.csproj", "src/NPin.Application.Contracts/"] -COPY ["src/NPin.Domain.Shared/NPin.Domain.Shared.csproj", "src/NPin.Domain.Shared/"] -COPY ["src/NPin.Domain/NPin.Domain.csproj", "src/NPin.Domain/"] -COPY ["src/NPin.SqlSugarCore/NPin.SqlSugarCore.csproj", "src/NPin.SqlSugarCore/"] -COPY ["framework/NPin.Framework.SqlSugarCore/NPin.Framework.SqlSugarCore.csproj", "framework/NPin.Framework.SqlSugarCore/"] -COPY ["module/bbs/NPin.Framework.Bbs.SqlSugarCore/NPin.Framework.Bbs.SqlSugarCore.csproj", "module/bbs/NPin.Framework.Bbs.SqlSugarCore/"] -COPY ["module/rbac/NPin.Framework.Rbac.SqlSugarCore/NPin.Framework.Rbac.SqlSugarCore.csproj", "module/rbac/NPin.Framework.Rbac.SqlSugarCore/"] -RUN dotnet restore "./src/NPin.Web/./NPin.Web.csproj" -COPY . . -WORKDIR "/src/src/NPin.Web" -RUN dotnet build "./NPin.Web.csproj" -c $BUILD_CONFIGURATION -o /app/build - -FROM build AS publish -ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./NPin.Web.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false - -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +USER app +WORKDIR /app +EXPOSE 8080 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["src/NPin.Web/NPin.Web.csproj", "src/NPin.Web/"] +COPY ["framework/NPin.Framework.AspNetCore.Authentication.OAuth/NPin.Framework.AspNetCore.Authentication.OAuth.csproj", "framework/NPin.Framework.AspNetCore.Authentication.OAuth/"] +COPY ["framework/NPin.Framework.AspNetCore/NPin.Framework.AspNetCore.csproj", "framework/NPin.Framework.AspNetCore/"] +COPY ["framework/NPin.Framework.Core/NPin.Framework.Core.csproj", "framework/NPin.Framework.Core/"] +COPY ["src/NPin.Application/NPin.Application.csproj", "src/NPin.Application/"] +COPY ["framework/NPin.Framework.Ddd.Application/NPin.Framework.Ddd.Application.csproj", "framework/NPin.Framework.Ddd.Application/"] +COPY ["framework/NPin.Framework.Ddd.Application.Contracts/NPin.Framework.Ddd.Application.Contracts.csproj", "framework/NPin.Framework.Ddd.Application.Contracts/"] +COPY ["module/upms/NPin.Framework.Upms.Application/NPin.Framework.Upms.Application.csproj", "module/upms/NPin.Framework.Upms.Application/"] +COPY ["module/upms/NPin.Framework.Upms.Application.Contracts/NPin.Framework.Upms.Application.Contracts.csproj", "module/upms/NPin.Framework.Upms.Application.Contracts/"] +COPY ["module/upms/NPin.Framework.Upms.Domain.Shared/NPin.Framework.Upms.Domain.Shared.csproj", "module/upms/NPin.Framework.Upms.Domain.Shared/"] +COPY ["framework/NPin.Framework.Mapster/NPin.Framework.Mapster.csproj", "framework/NPin.Framework.Mapster/"] +COPY ["framework/NPin.Framework.SqlSugarCore.Abstractions/NPin.Framework.SqlSugarCore.Abstractions.csproj", "framework/NPin.Framework.SqlSugarCore.Abstractions/"] +COPY ["module/upms/NPin.Framework.Upms.Domain/NPin.Framework.Upms.Domain.csproj", "module/upms/NPin.Framework.Upms.Domain/"] +COPY ["src/NPin.Application.Contracts/NPin.Application.Contracts.csproj", "src/NPin.Application.Contracts/"] +COPY ["src/NPin.Domain.Shared/NPin.Domain.Shared.csproj", "src/NPin.Domain.Shared/"] +COPY ["src/NPin.Domain/NPin.Domain.csproj", "src/NPin.Domain/"] +COPY ["src/NPin.SqlSugarCore/NPin.SqlSugarCore.csproj", "src/NPin.SqlSugarCore/"] +COPY ["framework/NPin.Framework.SqlSugarCore/NPin.Framework.SqlSugarCore.csproj", "framework/NPin.Framework.SqlSugarCore/"] +COPY ["module/upms/NPin.Framework.Upms.SqlSugarCore/NPin.Framework.Upms.SqlSugarCore.csproj", "module/upms/NPin.Framework.Upms.SqlSugarCore/"] +RUN dotnet restore "./src/NPin.Web/./NPin.Web.csproj" +COPY . . +WORKDIR "/src/src/NPin.Web" +RUN dotnet build "./NPin.Web.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./NPin.Web.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "NPin.Web.dll"] \ No newline at end of file diff --git a/src/NPin.Web/appsettings.Development.json b/src/NPin.Web/appsettings.Development.json deleted file mode 100644 index 0c208ae..0000000 --- a/src/NPin.Web/appsettings.Development.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/src/NPin.Web/appsettings.json b/src/NPin.Web/appsettings.json index cbe8703..39b87e5 100644 --- a/src/NPin.Web/appsettings.json +++ b/src/NPin.Web/appsettings.json @@ -1,66 +1,82 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Debug", - "Microsoft.AspNetCore": "Warning" - } - }, - "App": { - "SelfUrl": "http://*:19001", - "CorsOrigins": "http://localhost:19001;http://localhost:18000" - }, - "DbList": [ - "Sqlite", - "Mysql", - "Sqlserver", - "Oracle", - "Postgresql" - ], - "DbConnOptions": { - "Url": "DataSource=np-dev.db", - "DbType": "Sqlite", - "EnabledReadWrite": false, - "EnabledCodeFirst": true, - "EnabledSqlLog": true, - "EnabledDbSeed": true, - "EnabledSaasMultiTenancy": false - }, - "Redis": { - "IsEnabled": false, - "Configuration": "192.168.1.100:6379,password=,defaultDatabase=10" - }, - "JwtOptions": { - "Issuer": "NoahLan", - "Audience": "NoahLan", - "SecurityKey": "zqxwcevrbtnymu312412ihe9rfwhe78rh23djoi32hrui3ryf9e8wfh34iuj54y0934uti4h97fgw7hf97wyh8yy69520", - "ExpiresMinuteTime": 86400 - }, - "RefreshJwtOptions": { - "Issuer": "NoahLan", - "Audience": "NoahLan", - "SecurityKey": "67ij4o6jo4i5j6io45j6i4j74p5k6i54ojoi5t9g8ergoj34ofgkrtbmreog894jbioemgropihj48rj4io5juopjgior", - "ExpiresMinuteTime": 172800 - }, - "OAuth": { - "QQ": { - "ClientId": "", - "ClientSecret": "", - "RedirectUri": "" - }, - "Gitee": { - "ClientId": "", - "ClientSecret": "", - "RedirectUri": "" - } - }, - "RbacOptions": { - //超级管理员种子数据默认密码 - "AdminPassword": "123456", - //是否开启验证码验证 - "EnableCaptcha": true, - //是否开启注册功能 - "EnableRegister": false, - //开启定时数据库备份 - "EnableDataBaseBackup": false - } -} +{ + "Logging": { + "LogLevel": { + // "Default": "Information", + "Default": "Debug", + "Microsoft.AspNetCore": "Warning" + } + }, + // 应用启动 + "App": { + "SelfUrl": "http://*:19001", + "CorsOrigins": "http://localhost:19001;http://localhost:18000" + }, + // 数据库类型列表 + "DbList": [ + "Sqlite", + "Mysql", + "Sqlserver", + "Oracle", + "Postgresql" + ], + "DbConnOptions": { + "Url": "DataSource=np-dev.db", + "DbType": "Sqlite", + "EnabledReadWrite": false, + "EnabledCodeFirst": true, + "EnabledSqlLog": true, + "EnabledDbSeed": true, + // SAAS多租户 + "EnabledSaasMultiTenancy": false, + // 读写分离地址 + //"ReadUrl": [ + // "DataSource=[xxxx]", //Sqlite + // "server=[xxxx];port=3306;database=[xxxx];user id=[xxxx];password=[xxxx]", //Mysql + // "Data Source=[xxxx];Initial Catalog=[xxxx];User ID=[xxxx];password=[xxxx]" //Sqlserver + //] + }, + // Redis使用freesql 参数在 FreeSqlOptions的ConnectionStringBuilder中 + "Redis": { + "IsEnabled": false, + "Configuration": "192.168.1.100:6379,password=,defaultDatabase=10" + }, + // 鉴权 + "JwtOptions": { + "Issuer": "NoahLan", + "Audience": "NoahLan", + "SecurityKey": "zqxwcevrbtnymu312412ihe9rfwhe78rh23djoi32hrui3ryf9e8wfh34iuj54y0934uti4h97fgw7hf97wyh8yy69520", + "ExpiresMinuteTime": 86400 + }, + // 刷新Token + "RefreshJwtOptions": { + "Issuer": "NoahLan", + "Audience": "NoahLan", + "SecurityKey": "67ij4o6jo4i5j6io45j6i4j74p5k6i54ojoi5t9g8ergoj34ofgkrtbmreog894jbioemgropihj48rj4io5juopjgior", + "ExpiresMinuteTime": 172800 + }, + // 集成第三方登录 + "OAuth": { + "QQ": { + "ClientId": "", + "ClientSecret": "", + "RedirectUri": "" + }, + "Gitee": { + "ClientId": "", + "ClientSecret": "", + "RedirectUri": "" + } + }, + + // Rbac模块 + "RbacOptions": { + // 超级管理员种子数据默认密码 + "AdminPassword": "123456", + // 是否开启验证码验证 + "EnableCaptcha": true, + // 是否开启注册功能 + "EnableRegister": false, + // 开启定时数据库备份 + "EnableDataBaseBackup": false + } +}