Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom PostgreSQL configuration for API server endpoint #70

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lemois-1337
Copy link

The current configuration of the KGI API server presumes that the PostgreSQL database is hosted on the same machine as the API server, with both the API service and the PostgreSQL database being operated by the same system user. To enhance flexibility, this PR introduces a set of environment variables:

  • POSTGRES_USER: mandatory setting to define the username for database connection.
  • POSTGRES_PASSWORD: mandatory setting to define the password for database connection.
  • POSTGRES_DB: mandatory setting to define which database should be used.
  • POSTGRES_HOST: optional setting to define the host of the database server (default: localhost).
  • POSTGRES_PORT: optional setting to define the port for database connection (default: 5432).

The current configuration of the KGI API server presumes that the
PostgreSQL database is hosted on the same machine as the API server,
with both the API service and the PostgreSQL database being operated
by the same system user. To enhance flexibility, this update
introduces a set of environment variables:

* POSTGRES_USER: mandatory setting to define the username for database
  connection.
* POSTGRES_PASSWORD: mandatory setting to define the password for
  database connection.
* POSTGRES_DB: mandatory setting to define which database should be
  used.
* POSTGRES_HOST: optional setting to define the host of the database
  server (default: localhost).
* POSTGRES_PORT: optional setting to define the port for database
  connection (default: 5432).
@lemois-1337
Copy link
Author

lemois-1337 commented Jan 10, 2024

Actually, I forgot the dockerfiles update, will add with separate commit.

Both pg-pool and node-postgres are compatible with certain
environment variables similar to those supported by 'psql'.
However, this compatibility is not guaranteed, and there is
a risk of these variables being inadvertently modified in an
interactive shell when a user launches an API server from the
command line. To ensure consistency, the environment variables
have been synchronized with those used in 'kgi-processing' and
incorporated into the Docker Compose environment settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant