diff --git a/app.py b/app.py index 9bf4acb..86782db 100644 --- a/app.py +++ b/app.py @@ -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([ diff --git a/docker-compose.yml b/docker-compose.yml index 06dd7e8..955f0b0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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" \ No newline at end of file