Add pgweb and pgadmin in development env
This commit is contained in:
@@ -1,10 +1,20 @@
|
|||||||
|
using Microsoft.Extensions.Hosting;
|
||||||
using Vegasco.Server.AppHost.Shared;
|
using Vegasco.Server.AppHost.Shared;
|
||||||
|
|
||||||
IDistributedApplicationBuilder builder = DistributedApplication.CreateBuilder(args);
|
IDistributedApplicationBuilder builder = DistributedApplication.CreateBuilder(args);
|
||||||
|
|
||||||
IResourceBuilder<PostgresDatabaseResource> postgres = builder.AddPostgres(Constants.Database.ServiceName)
|
IResourceBuilder<PostgresServerResource> postgresBuilder = builder.AddPostgres(Constants.Database.ServiceName)
|
||||||
.WithLifetime(ContainerLifetime.Persistent)
|
.WithLifetime(ContainerLifetime.Persistent)
|
||||||
.WithDataVolume()
|
.WithDataVolume();
|
||||||
|
|
||||||
|
if (builder.Environment.IsDevelopment())
|
||||||
|
{
|
||||||
|
postgresBuilder = postgresBuilder
|
||||||
|
.WithPgWeb()
|
||||||
|
.WithPgAdmin();
|
||||||
|
}
|
||||||
|
|
||||||
|
IResourceBuilder<PostgresDatabaseResource> postgres = postgresBuilder
|
||||||
.AddDatabase(Constants.Database.Name);
|
.AddDatabase(Constants.Database.Name);
|
||||||
|
|
||||||
IResourceBuilder<ProjectResource> api = builder
|
IResourceBuilder<ProjectResource> api = builder
|
||||||
|
|||||||
Reference in New Issue
Block a user