From 80a4a849f56b4de97c2b87f68c8f8c3b678eaf05 Mon Sep 17 00:00:00 2001 From: Nadica Rizova Date: Mon, 3 Jul 2023 10:41:35 +0200 Subject: [PATCH] added cmd in Dockerfile --- images/ckan/2.9/psql-init/Dockerfile | 2 ++ images/ckan/2.9/psql-init/psql-init/psql-init.py | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/images/ckan/2.9/psql-init/Dockerfile b/images/ckan/2.9/psql-init/Dockerfile index e1727ec..65fdf5e 100644 --- a/images/ckan/2.9/psql-init/Dockerfile +++ b/images/ckan/2.9/psql-init/Dockerfile @@ -17,3 +17,5 @@ RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application code to the container COPY psql-init/ . +CMD ["python", "/srv/psql-init.py"] + diff --git a/images/ckan/2.9/psql-init/psql-init/psql-init.py b/images/ckan/2.9/psql-init/psql-init/psql-init.py index 507b551..6eb25cb 100644 --- a/images/ckan/2.9/psql-init/psql-init/psql-init.py +++ b/images/ckan/2.9/psql-init/psql-init/psql-init.py @@ -248,12 +248,12 @@ def execute_sql_script(ckan_dbp, datastorero_dbp, datastorerw_dbp, script_path): print("SQL script executed successfully.") - # print("CKAN DB User:", ckan_dbp.db_user) - # print("read/write DB User:", datastorerw_dbp.db_user) - # print("read/write DB name:", datastorerw_dbp.db_name) - # print("read/write host:", datastorerw_dbp.db_host) - # print("read DB user:", datastorero_dbp.db_user) - # print("read DB name:", datastorero_dbp.db_name) + print("CKAN DB User:", ckan_dbp.db_user) + print("read/write DB User:", datastorerw_dbp.db_user) + print("read/write DB name:", datastorerw_dbp.db_name) + print("read/write host:", datastorerw_dbp.db_host) + print("read DB user:", datastorero_dbp.db_user) + print("read DB name:", datastorero_dbp.db_name) except psycopg2.Error as e: print(f"Error executing SQL script: {str(e)}")