add docker, deploy

This commit is contained in:
Alex Bezdieniezhnykh
2024-11-14 16:12:06 +02:00
parent 4445fcd673
commit 2244edd2ed
15 changed files with 215 additions and 29 deletions
+1
View File
@@ -0,0 +1 @@
ASPNETCORE_JwtConfig__Secret=sdkfjghbsdfklhjgvbsdkljfhbvasklhfgsdfvh
+1
View File
@@ -4,6 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
-6
View File
@@ -1,6 +0,0 @@
@Azaion.Api_HostAddress = http://localhost:5219
GET {{Azaion.Api_HostAddress}}/weatherforecast/
Accept: application/json
###
+1 -2
View File
@@ -16,7 +16,7 @@ var builder = WebApplication.CreateBuilder(args);
builder.WebHost.ConfigureKestrel(o => o.Limits.MaxRequestBodySize = 209715200); //increase upload limit up to 200mb
var jwtConfig = builder.Configuration.GetSection(nameof(JwtConfig)).Get<JwtConfig>();
if (jwtConfig == null)
if (jwtConfig == null || string.IsNullOrEmpty(jwtConfig.Secret))
throw new Exception("Missing configuration section: JwtConfig");
var signingKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(jwtConfig.Secret));
@@ -87,7 +87,6 @@ if (app.Environment.IsDevelopment())
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthentication();
app.UseAuthorization();
-4
View File
@@ -4,9 +4,5 @@
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"AzaionDb": "Host=localhost;Database=azaion;Username=azaion_reader;Password=Az@1on_re@d!only@$Az;",
"AzaionDbAdmin": "Host=localhost;Database=azaion;Username=azaion_admin;Password=Az@1on_admin$$@r;"
}
}