Skip to content

Commit

Permalink
Merge pull request #1 from Sean-Stilwell/ghcr-switch
Browse files Browse the repository at this point in the history
switching to ghcr
  • Loading branch information
Sean-Stilwell authored Jun 10, 2024
2 parents 2e8db8d + 872f7a6 commit 143f9d7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
31 changes: 20 additions & 11 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,27 @@
import psycopg2
import pandas as pd

KEY_VAULT_URL = "https://fsdh-proj-dw1-poc-kv.vault.azure.net/"
credential = DefaultAzureCredential()
secret_client = SecretClient(vault_url=KEY_VAULT_URL, credential=credential)

# Retrieve the secrets containing DB connection details
DB_NAME = "fsdh"
DB_HOST = secret_client.get_secret("datahub-psql-server").value
DB_USER = secret_client.get_secret("datahub-psql-admin").value
DB_PASS = secret_client.get_secret("datahub-psql-password").value

# Initialize the Dash app
app = dash.Dash(__name__)
app = dash.Dash(__name__,
requests_pathname_prefix="/webapp-DIE3/",
routes_pathname_prefix="/webapp-DIE3/")

KEY_VAULT_URL = "https://fsdh-proj-dw1-poc-kv.vault.azure.net/"
error_occur = False

try:
# Retrieve the secrets containing DB connection details
credential = DefaultAzureCredential()
secret_client = SecretClient(vault_url=KEY_VAULT_URL, credential=credential)

# Retrieve the secrets containing DB connection details
DB_NAME = "fsdh"
DB_HOST = secret_client.get_secret("datahub-psql-server").value
DB_USER = secret_client.get_secret("datahub-psql-admin").value
DB_PASS = secret_client.get_secret("datahub-psql-password").value
except Exception as e:
error_occur = True
print(f"An error occurred: {e}")

# Define the layout of the app
app.layout = html.Div([
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: '3.8'
services:
web:
build: .
image: seanstilwell/dash-fsdh-sample:latest
image: ghcr.io/ssc-sp/fsdh-dash-sample:latest
container_name: dash-app
ports:
- "80:80"

0 comments on commit 143f9d7

Please sign in to comment.