Skip to content

Commit

Permalink
feat(single-project): 增加单体项目配置
Browse files Browse the repository at this point in the history
  • Loading branch information
colinin committed Oct 10, 2024
1 parent 33dbda5 commit 137ffd8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone

EXPOSE 80/tcp
VOLUME [ "./app/blobs" ]
VOLUME [ "./app/Logs" ]
VOLUME [ "./app/Modules" ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace LY.MicroService.Applications.Single;
public partial class MicroServiceApplicationsSingleModule
{
protected const string DefaultCorsPolicyName = "Default";
protected const string ApplicationName = "MicroService-Applications-Single";
public static string ApplicationName { get; set; } = "MicroService-Applications-Single";
private readonly static OneTimeRunner OneTimeRunner = new();

private void PreConfigureFeature()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@

await builder.AddApplicationAsync<MicroServiceApplicationsSingleModule>(options =>
{
MicroServiceApplicationsSingleModule.ApplicationName = Environment.GetEnvironmentVariable("APPLICATION_NAME")
?? MicroServiceApplicationsSingleModule.ApplicationName;
options.ApplicationName = MicroServiceApplicationsSingleModule.ApplicationName;
// 从环境变量取用户机密配置, 适用于容器测试
options.Configuration.UserSecretsId = Environment.GetEnvironmentVariable("APPLICATION_USER_SECRETS_ID");
// 如果容器没有指定用户机密, 从项目读取
Expand Down

0 comments on commit 137ffd8

Please sign in to comment.