added cmd in Dockerfile

This commit is contained in:
Nadica Rizova 2023-07-03 10:41:35 +02:00
parent 47fe1b8cce
commit 80a4a849f5
2 changed files with 8 additions and 6 deletions

View File

@ -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"]

View File

@ -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)}")