Skip to content

Commit 92496a0

Browse files
committed
add db host to notebook
1 parent 1c37406 commit 92496a0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

samples/jupyter-postgres/compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
environment:
1212
JUPYTER_TOKEN:
1313
POSTGRES_PASSWORD:
14+
DATABASE_HOST: db
1415
healthcheck:
1516
test: ["CMD", "curl", "-f", "http://localhost:8888/login" ]
1617
depends_on:

samples/jupyter-postgres/jupyter/notebooks/Titanic.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@
7070
},
7171
{
7272
"cell_type": "code",
73-
"execution_count": 3,
73+
"execution_count": null,
7474
"id": "0f663e69-0d11-4bbc-b594-df4cc0497aeb",
7575
"metadata": {},
7676
"outputs": [],
7777
"source": [
7878
"import os\n",
7979
"DB_USER = 'postgres'\n",
8080
"DB_PASSWORD = os.getenv('POSTGRES_PASSWORD')\n",
81-
"DB_HOST = 'db' # Docker Compose service name\n",
81+
"DB_HOST = os.getenv('DATABASE_HOST') # Docker Compose service name\n",
8282
"DB_PORT = '5432'\n",
8383
"DB_NAME = 'postgres'"
8484
]

0 commit comments

Comments
 (0)