Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Vulkan2Blazor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vulkan2Blazor", "Vulkan2Blazor\Vulkan2Blazor.csproj", "{52A5CDEF-EFCB-4C24-82D0-2DCEC6E69FD3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5DA684E1-853E-461D-AD1D-E7B14ADB7FB9}"
ProjectSection(SolutionItems) = preProject
compose.yaml = compose.yaml
.env = .env
compose-dev.yml = compose-dev.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
14 changes: 13 additions & 1 deletion Vulkan2Blazor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
.AddIdentityCookies();

builder.Services.AddDbContextFactory<Vulkan2Context>(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString("Vulkan2Context") ?? throw new InvalidOperationException("Connection string 'Vulkan2Context' not found.")));
options.UseNpgsql(builder.Configuration.GetConnectionString("Vulkan2Context") ??
throw new InvalidOperationException("Connection string 'Vulkan2Context' not found.")));

builder.Services.AddQuickGridEntityFrameworkAdapter();

Expand All @@ -48,8 +49,17 @@

builder.Services.AddSingleton<IEmailSender<ApplicationUser>, IdentityNoOpEmailSender>();

builder.Services.AddControllers();

var app = builder.Build();

// Apply migrations on startup
using (var scope = app.Services.CreateScope())
{
var dbContext = scope.ServiceProvider.GetRequiredService<Vulkan2Context>();
dbContext.Database.Migrate();
}

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
Expand All @@ -71,6 +81,8 @@
app.MapStaticAssets();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.MapBlazorHub();
app.MapControllers();

// Add additional endpoints required by the Identity /Account Razor components.
app.MapAdditionalIdentityEndpoints();
Expand Down
1 change: 1 addition & 0 deletions Vulkan2Blazor/Vulkan2Blazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
Expand Down
38 changes: 38 additions & 0 deletions compose-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
services:
vulkan2blazor:
image: vulkan2blazor
build:
context: .
dockerfile: Vulkan2Blazor/Dockerfile
ports:
- "8080:8080"
environment:
ASPNETCORE_ENVIRONMENT: "Development"
# ASPNETCORE_URLS: "http://localhost:8080"
ConnectionStrings__Vulkan2Context: 'Host=postgres;Port=5432;Database=${POSTGRES_DB};Username=${POSTGRES_USER};Password=${POSTGRES_PASSWORD}'
depends_on:
postgres:
condition: service_healthy
# volumes:
# - vulkan2:/home/app/.aspnet/DataProtection-Keys

postgres:
image: postgres
restart: always
user: postgres
env_file:
- .env
ports:
- "5432:5432"
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5

volumes:
postgres:
# vulkan2:

35 changes: 35 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
services:
vulkan2blazor:
image: vulkan2blazor:latest
ports:
- "8080:8080"
environment:
ASPNETCORE_ENVIRONMENT: "Development"
# ASPNETCORE_URLS: "http://localhost:8080"
ConnectionStrings__Vulkan2Context: 'Host=postgres;Port=5432;Database=${POSTGRES_DB};Username=${POSTGRES_USER};Password=${POSTGRES_PASSWORD}'
depends_on:
postgres:
condition: service_healthy
# volumes:
# - vulkan2:/home/app/.aspnet/DataProtection-Keys

postgres:
image: postgres
restart: always
user: postgres
env_file:
- .env
ports:
- "5432:5432"
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5

volumes:
postgres:
# vulkan2:

Loading