From 1053c55f5f871b2cb5e2d04d01a777c630b58044 Mon Sep 17 00:00:00 2001
From: David Hintermann <David.Hintermann@ost.ch>
Date: Sat, 30 Nov 2024 12:51:07 +0000
Subject: [PATCH] feat(dashboard): add mor graphs

---
 .env.sample              | 6 +++++-
 Frontend/Frontend.csproj | 1 +
 Frontend/Program.cs      | 3 +++
 docker-compose.yml       | 5 +++--
 4 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/.env.sample b/.env.sample
index 03ce735..b98930e 100644
--- a/.env.sample
+++ b/.env.sample
@@ -1,2 +1,6 @@
 API_URL=https://sepolia.infura.io/v3/{yourApiKey}
-ACCOUNT_PRIVATE_KEY=
\ No newline at end of file
+ACCOUNT_PRIVATE_KEY=
+POSTGRES_HOST=postgres
+POSTGRES_PORT=5432
+POSTGRES_DB=roesticoin
+POSTGRES_USER=roesticoin
\ No newline at end of file
diff --git a/Frontend/Frontend.csproj b/Frontend/Frontend.csproj
index d114f36..a98f3f8 100644
--- a/Frontend/Frontend.csproj
+++ b/Frontend/Frontend.csproj
@@ -1,5 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
   <ItemGroup>
+    <PackageReference Include="DotNetEnv" Version="3.1.1" />
     <PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.11" />
     <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
     <PackageReference Include="Nethereum.Web3" Version="4.26.0" />
diff --git a/Frontend/Program.cs b/Frontend/Program.cs
index de4846d..046fc23 100644
--- a/Frontend/Program.cs
+++ b/Frontend/Program.cs
@@ -9,11 +9,14 @@ using Frontend.Metrics;
 using Nethereum.Web3;
 using Nethereum.Web3.Accounts;
 using Microsoft.EntityFrameworkCore;
+using DotNetEnv;
 
 using OpenTelemetry.Metrics;
 using OpenTelemetry.Resources;
 using Org.BouncyCastle.Utilities;
 
+// ensure the env file is loaded
+Env.Load("../.env");
 // the location differ in dev and releas mode.
 var tokenAbiLocation = Environment.GetEnvironmentVariable("TOKEN_ABI_LOCATION")!;
 var tokenAbi = File.ReadAllText(tokenAbiLocation)!;
diff --git a/docker-compose.yml b/docker-compose.yml
index 7ccf980..ee7cee2 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -38,7 +38,7 @@ services:
     image: dpage/pgadmin4
     restart: unless-stopped
     ports:
-      - "5050:5050"
+      - "5050:80"
     environment:
       PGADMIN_DEFAULT_EMAIL: 'roesti@example.com'
       PGADMIN_DEFAULT_PASSWORD: 'TheRoestiCoinsPgAdmin'
@@ -47,7 +47,8 @@ services:
       - .env
     ports:
       - 8080:8080
-
+    depends_on:
+      - postgres
 volumes:
   prometheus_data:
   postgres_data:
-- 
GitLab