From 4cc6edbcf1a59b7fa2e47b465a4e8d3aeaf61b8d Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Wed, 3 Nov 2021 21:10:52 +0800 Subject: [PATCH] fix: fixed some bugs --- .../ElasticsearchAuditLogManager.cs | 4 +- .../ElasticsearchSecurityLogManager.cs | 4 +- .../Elasticsearch/AbpElasticsearchOptions.cs | 2 - .../LINGYUN/Platform/Menus/IMenuRepository.cs | 9 ++ .../Platform/Menus/EfCoreMenuRepository.cs | 10 ++ .../account/AuthServer.Host/Dockerfile | 25 ++-- .../BackendAdminHostModule.cs | 4 +- ...NGYUN.Abp.BackendAdmin.HttpApi.Host.csproj | 2 +- .../LINGYUN.ApiGateway.Host/Dockerfile | 25 ++-- .../Dockerfile | 25 ++-- .../Permissions/PermissionChecker.cs | 139 ------------------ .../Dockerfile | 27 ++-- .../Dockerfile | 25 ++-- .../Dockerfile | 25 ++-- .../LINGYUN.Platform.HttpApi.Host/Dockerfile | 26 ++-- docker-compose.override.yml | 7 + 16 files changed, 126 insertions(+), 233 deletions(-) delete mode 100644 aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Volo/Abp/Authorization/Permissions/PermissionChecker.cs diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs index 0a34de761..fee2d868e 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs @@ -17,7 +17,7 @@ using Volo.Abp; namespace LINGYUN.Abp.AuditLogging.Elasticsearch { [Dependency(ReplaceServices = true)] - public class ElasticsearchAuditLogManager : IAuditLogManager, ISingletonDependency + public class ElasticsearchAuditLogManager : IAuditLogManager, ITransientDependency { private readonly AbpAuditingOptions _auditingOptions; private readonly AbpElasticsearchOptions _elasticsearchOptions; @@ -31,7 +31,7 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch public ElasticsearchAuditLogManager( ICurrentTenant currentTenant, IOptions elasticsearchOptions, - IOptions options, + IOptionsSnapshot options, IElasticsearchClientFactory clientFactory, IOptions auditingOptions, IAuditLogInfoToAuditLogConverter converter) diff --git a/aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs b/aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs index 0f718ba03..418738bc6 100644 --- a/aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs +++ b/aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs @@ -16,7 +16,7 @@ using Volo.Abp.SecurityLog; namespace LINGYUN.Abp.AuditLogging.Elasticsearch { [Dependency(ReplaceServices = true)] - public class ElasticsearchSecurityLogManager : ISecurityLogManager, ISingletonDependency + public class ElasticsearchSecurityLogManager : ISecurityLogManager, ITransientDependency { private readonly AbpSecurityLogOptions _securityLogOptions; private readonly AbpElasticsearchOptions _elasticsearchOptions; @@ -32,7 +32,7 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch IGuidGenerator guidGenerator, IOptions securityLogOptions, IOptions elasticsearchOptions, - IOptions options, + IOptionsSnapshot options, IElasticsearchClientFactory clientFactory) { _options = options.Value; diff --git a/aspnet-core/modules/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs b/aspnet-core/modules/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs index 19900b9af..4bd224ea7 100644 --- a/aspnet-core/modules/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs +++ b/aspnet-core/modules/elasticsearch/LINGYUN.Abp.Elasticsearch/LINGYUN/Abp/Elasticsearch/AbpElasticsearchOptions.cs @@ -15,7 +15,6 @@ namespace LINGYUN.Abp.Elasticsearch /// 默认:false /// public bool FieldCamelCase { get; set; } - public string TypeName { get; set; } public string NodeUris { get; set; } public int ConnectionLimit { get; set; } public string UserName { get; set; } @@ -26,7 +25,6 @@ namespace LINGYUN.Abp.Elasticsearch public AbpElasticsearchOptions() { - TypeName = "_doc"; ConnectionLimit = ConnectionConfiguration.DefaultConnectionLimit; ConnectionTimeout = ConnectionConfiguration.DefaultTimeout; } diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs index 3ef443eac..69f01757f 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Menus/IMenuRepository.cs @@ -9,6 +9,15 @@ namespace LINGYUN.Platform.Menus public interface IMenuRepository : IBasicRepository { /// + /// 获取最后一个菜单 + /// + /// + /// + /// + Task GetLastMenuAsync( + Guid? parentId = null, + CancellationToken cancellationToken = default); + /// /// 根据名称查询菜单 /// /// diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs index 46593fee7..039ec60a1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Menus/EfCoreMenuRepository.cs @@ -19,6 +19,16 @@ namespace LINGYUN.Platform.Menus { } + public virtual async Task GetLastMenuAsync( + Guid? parentId = null, + CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(x => x.ParentId == parentId) + .OrderByDescending(x => x.CreationTime) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } + public virtual async Task UserHasInMenuAsync( Guid userId, string menuName, diff --git a/aspnet-core/services/account/AuthServer.Host/Dockerfile b/aspnet-core/services/account/AuthServer.Host/Dockerfile index 0ae741879..ae622adca 100644 --- a/aspnet-core/services/account/AuthServer.Host/Dockerfile +++ b/aspnet-core/services/account/AuthServer.Host/Dockerfile @@ -1,13 +1,14 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0 -LABEL maintainer="colin.in@foxmail.com" -WORKDIR /app - -COPY . /app - -ENV TZ=Asia/Shanghai -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone - -EXPOSE 80/tcp -VOLUME [ "./app/Logs" ] - +FROM mcr.microsoft.com/dotnet/aspnet:5.0 +LABEL maintainer="colin.in@foxmail.com" +WORKDIR /app + +COPY . /app + +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone + +EXPOSE 80/tcp +VOLUME [ "./app/Logs" ] +VOLUME [ "./app/Modules" ] + ENTRYPOINT ["dotnet", "AuthServer.Host.dll"] \ No newline at end of file diff --git a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs index 5b567d08c..618b10e50 100644 --- a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs +++ b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs @@ -19,7 +19,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Volo.Abp; using Volo.Abp.AspNetCore.Authentication.JwtBearer; -using Volo.Abp.AspNetCore.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Autofac; using Volo.Abp.Caching.StackExchangeRedis; @@ -43,7 +43,7 @@ namespace LINGYUN.Abp.BackendAdmin typeof(AbpAspNetCoreSerilogModule), typeof(AbpLoggingSerilogElasticsearchModule), typeof(AbpAuditLoggingElasticsearchModule), - typeof(AbpAspNetCoreMultiTenancyModule), + typeof(AbpAspNetCoreMvcUiMultiTenancyModule), typeof(AbpSettingManagementApplicationModule), typeof(AbpSettingManagementHttpApiModule), typeof(AbpPermissionManagementApplicationModule), diff --git a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj index a1616e9df..e37574641 100644 --- a/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj +++ b/aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/LINGYUN.Abp.BackendAdmin.HttpApi.Host.csproj @@ -42,7 +42,7 @@ - + diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/Dockerfile b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/Dockerfile index c94c5a31c..1354aa0a1 100644 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/Dockerfile +++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/Dockerfile @@ -1,13 +1,14 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0 -LABEL maintainer="colin.in@foxmail.com" -WORKDIR /app - -COPY . /app - -ENV TZ=Asia/Shanghai -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone - -EXPOSE 80/tcp -VOLUME [ "./app/Logs" ] - +FROM mcr.microsoft.com/dotnet/aspnet:5.0 +LABEL maintainer="colin.in@foxmail.com" +WORKDIR /app + +COPY . /app + +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone + +EXPOSE 80/tcp +VOLUME [ "./app/Logs" ] +VOLUME [ "./app/Modules" ] + ENTRYPOINT ["dotnet", "LINGYUN.ApiGateway.Host.dll"] \ No newline at end of file diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Dockerfile b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Dockerfile index 4b160025d..ec286f1e9 100644 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Dockerfile +++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Dockerfile @@ -1,13 +1,14 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0 -LABEL maintainer="colin.in@foxmail.com" -WORKDIR /app - -COPY . /app - -ENV TZ=Asia/Shanghai -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone - -EXPOSE 80/tcp -VOLUME [ "./app/Logs" ] - +FROM mcr.microsoft.com/dotnet/aspnet:5.0 +LABEL maintainer="colin.in@foxmail.com" +WORKDIR /app + +COPY . /app + +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone + +EXPOSE 80/tcp +VOLUME [ "./app/Logs" ] +VOLUME [ "./app/Modules" ] + ENTRYPOINT ["dotnet", "LINGYUN.ApiGateway.HttpApi.Host.dll"] \ No newline at end of file diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Volo/Abp/Authorization/Permissions/PermissionChecker.cs b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Volo/Abp/Authorization/Permissions/PermissionChecker.cs deleted file mode 100644 index 1b549039a..000000000 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/Volo/Abp/Authorization/Permissions/PermissionChecker.cs +++ /dev/null @@ -1,139 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Security.Principal; -using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; -using Volo.Abp.MultiTenancy; -using Volo.Abp.Security.Claims; - -namespace Volo.Abp.Authorization.Permissions -{ - [Dependency(ServiceLifetime.Transient, ReplaceServices = true)] - [ExposeServices(typeof(IPermissionChecker))] - public class PermissionChecker : IPermissionChecker - { - protected IPermissionDefinitionManager PermissionDefinitionManager { get; } - protected ICurrentPrincipalAccessor PrincipalAccessor { get; } - protected ICurrentTenant CurrentTenant { get; } - protected IPermissionValueProviderManager PermissionValueProviderManager { get; } - - public PermissionChecker( - ICurrentPrincipalAccessor principalAccessor, - IPermissionDefinitionManager permissionDefinitionManager, - ICurrentTenant currentTenant, - IPermissionValueProviderManager permissionValueProviderManager) - { - PrincipalAccessor = principalAccessor; - PermissionDefinitionManager = permissionDefinitionManager; - CurrentTenant = currentTenant; - PermissionValueProviderManager = permissionValueProviderManager; - } - - public virtual async Task IsGrantedAsync(string name) - { - return await IsGrantedAsync(PrincipalAccessor.Principal, name); - } - - public virtual async Task IsGrantedAsync( - ClaimsPrincipal claimsPrincipal, - string name) - { - Check.NotNull(name, nameof(name)); - - var permission = PermissionDefinitionManager.Get(name); - - if (!permission.IsEnabled) - { - return false; - } - - var multiTenancySide = claimsPrincipal?.GetMultiTenancySide() - ?? CurrentTenant.GetMultiTenancySide(); - - if (!permission.MultiTenancySide.HasFlag(multiTenancySide)) - { - return false; - } - - var isGranted = false; - var context = new PermissionValueCheckContext(permission, claimsPrincipal); - foreach (var provider in PermissionValueProviderManager.ValueProviders) - { - if (context.Permission.Providers.Any() && - !context.Permission.Providers.Contains(provider.Name)) - { - continue; - } - - var result = await provider.CheckAsync(context); - - if (result == PermissionGrantResult.Granted) - { - isGranted = true; - } - else if (result == PermissionGrantResult.Prohibited) - { - return false; - } - } - - return isGranted; - } - - public async Task IsGrantedAsync(string[] names) - { - return await IsGrantedAsync(PrincipalAccessor.Principal, names); - } - - public async Task IsGrantedAsync(ClaimsPrincipal claimsPrincipal, string[] names) - { - Check.NotNull(names, nameof(names)); - - var multiTenancySide = claimsPrincipal?.GetMultiTenancySide() ?? CurrentTenant.GetMultiTenancySide(); - - var result = new MultiplePermissionGrantResult(); - if (!names.Any()) - { - return result; - } - - var permissionDefinitions = new List(); - foreach (var name in names) - { - var permission = PermissionDefinitionManager.Get(name); - - result.Result.Add(name, PermissionGrantResult.Undefined); - - if (permission.IsEnabled && permission.MultiTenancySide.HasFlag(multiTenancySide)) - { - permissionDefinitions.Add(permission); - } - } - - foreach (var provider in PermissionValueProviderManager.ValueProviders) - { - var context = new PermissionValuesCheckContext( - permissionDefinitions.Where(x => !x.Providers.Any() || x.Providers.Contains(provider.Name)).ToList(), - claimsPrincipal); - - var multipleResult = await provider.CheckAsync(context); - foreach (var grantResult in multipleResult.Result.Where(grantResult => - result.Result.ContainsKey(grantResult.Key) && - result.Result[grantResult.Key] == PermissionGrantResult.Undefined && - grantResult.Value != PermissionGrantResult.Undefined)) - { - result.Result[grantResult.Key] = grantResult.Value; - permissionDefinitions.RemoveAll(x => x.Name == grantResult.Key); - } - - if (result.AllGranted || result.AllProhibited) - { - break; - } - } - return result; - } - } -} \ No newline at end of file diff --git a/aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/Dockerfile b/aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/Dockerfile index 5ff0669ed..7989a8aa5 100644 --- a/aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/Dockerfile +++ b/aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/Dockerfile @@ -1,13 +1,14 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0 -LABEL maintainer="colin.in@foxmail.com" -WORKDIR /app - -COPY . /app - -ENV TZ=Asia/Shanghai -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone - -EXPOSE 80/tcp -VOLUME [ "./app/Logs" ] - -ENTRYPOINT ["dotnet", "LINGYUN.Abp.IdentityServer4.HttpApi.Host.dll"] +FROM mcr.microsoft.com/dotnet/aspnet:5.0 +LABEL maintainer="colin.in@foxmail.com" +WORKDIR /app + +COPY . /app + +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone + +EXPOSE 80/tcp +VOLUME [ "./app/Logs" ] +VOLUME [ "./app/Modules" ] + +ENTRYPOINT ["dotnet", "LINGYUN.Abp.IdentityServer4.HttpApi.Host.dll"] diff --git a/aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/Dockerfile b/aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/Dockerfile index de2939363..463be1697 100644 --- a/aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/Dockerfile +++ b/aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/Dockerfile @@ -1,13 +1,14 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0 -LABEL maintainer="colin.in@foxmail.com" -WORKDIR /app - -COPY . /app - -ENV TZ=Asia/Shanghai -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone - -EXPOSE 80/tcp -VOLUME [ "./app/Logs" ] - +FROM mcr.microsoft.com/dotnet/aspnet:5.0 +LABEL maintainer="colin.in@foxmail.com" +WORKDIR /app + +COPY . /app + +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone + +EXPOSE 80/tcp +VOLUME [ "./app/Logs" ] +VOLUME [ "./app/Modules" ] + ENTRYPOINT ["dotnet", "LINGYUN.Abp.LocalizationManagement.HttpApi.Host.dll"] \ No newline at end of file diff --git a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Dockerfile b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Dockerfile index 29f140b4e..9ce81ef1b 100644 --- a/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Dockerfile +++ b/aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/Dockerfile @@ -1,13 +1,14 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0 -LABEL maintainer="colin.in@foxmail.com" -WORKDIR /app - -COPY . /app - -ENV TZ=Asia/Shanghai -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone - -EXPOSE 80/tcp -VOLUME [ "./app/Logs" ] - +FROM mcr.microsoft.com/dotnet/aspnet:5.0 +LABEL maintainer="colin.in@foxmail.com" +WORKDIR /app + +COPY . /app + +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone + +EXPOSE 80/tcp +VOLUME [ "./app/Logs" ] +VOLUME [ "./app/Modules" ] + ENTRYPOINT ["dotnet", "LINGYUN.Abp.MessageService.HttpApi.Host.dll"] \ No newline at end of file diff --git a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Dockerfile b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Dockerfile index 59b5d0864..8462dcdce 100644 --- a/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Dockerfile +++ b/aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/Dockerfile @@ -1,13 +1,15 @@ -FROM mcr.microsoft.com/dotnet/aspnet:5.0 -LABEL maintainer="colin.in@foxmail.com" -WORKDIR /app - -COPY . /app - -ENV TZ=Asia/Shanghai -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone - -EXPOSE 80/tcp -VOLUME [ "./app/Logs", "./app/file-blob-storing" ] - +FROM mcr.microsoft.com/dotnet/aspnet:5.0 +LABEL maintainer="colin.in@foxmail.com" +WORKDIR /app + +COPY . /app + +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone + +EXPOSE 80/tcp +VOLUME [ "./app/Logs" ] +VOLUME [ "./app/Modules" ] +VOLUME [ "./app/file-blob-storing" ] + ENTRYPOINT ["dotnet", "LINGYUN.Platform.HttpApi.Host.dll"] \ No newline at end of file diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 7d4d8ec4e..c356c94d6 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -6,6 +6,7 @@ services: context: ./aspnet-core/services/Publish/identityserver volumes: - /var/opt/abp/logs/ids-sts:/app/Logs + - /var/opt/abp/data/ids-sts/Modules:/app/Modules restart: always identity-server-admin: @@ -13,6 +14,7 @@ services: context: ./aspnet-core/services/Publish/identityserver4-admin volumes: - /var/opt/abp/logs/ids-admin:/app/Logs + - /var/opt/abp/data/ids-admin/Modules:/app/Modules depends_on: - identity-server-sts restart: always @@ -32,6 +34,7 @@ services: context: ./aspnet-core/services/Publish/localization volumes: - /var/opt/abp/logs/localization:/app/Logs + - /var/opt/abp/data/localization/Modules:/app/Modules restart: always platform-service: @@ -39,6 +42,7 @@ services: context: ./aspnet-core/services/Publish/platform volumes: - /var/opt/abp/logs/platform:/app/Logs + - /var/opt/abp/data/platform/Modules:/app/Modules - /var/opt/abp/data/platform:/app/file-blob-storing depends_on: - identity-server-sts @@ -49,6 +53,7 @@ services: context: ./aspnet-core/services/Publish/messages volumes: - /var/opt/abp/logs/messages:/app/Logs + - /var/opt/abp/data/messages/Modules:/app/Modules depends_on: - identity-server-sts restart: always @@ -58,6 +63,7 @@ services: context: ./aspnet-core/services/Publish/apigateway-admin volumes: - /var/opt/abp/logs/apigateway-admin:/app/Logs + - /var/opt/abp/data/apigateway-admin/Modules:/app/Modules depends_on: - identity-server-sts - admin-service @@ -68,6 +74,7 @@ services: context: ./aspnet-core/services/Publish/apigateway-host volumes: - /var/opt/abp/logs/apigateway-host:/app/Logs + - /var/opt/abp/data/apigateway-host/Modules:/app/Modules depends_on: - identity-server-sts - apigateway-admin-service