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

API: honour DB_HOST and DB_PORT #77

Merged
merged 1 commit into from
Mar 8, 2024
Merged

API: honour DB_HOST and DB_PORT #77

merged 1 commit into from
Mar 8, 2024

Conversation

JJ-8
Copy link
Owner

@JJ-8 JJ-8 commented Mar 8, 2024

API needs to wait for the database to be up before starting.

We do not know how long it takes: just because the container is started doesn't
mean that Postgres is ready. The workaround is to use a small script (start.sh)
that waits until a connection to the database can be done before passing the
execution to yarn.

The Dockerfile contains hardcoded values for the database's hostname and ports,
but there is no guarantee that these values are always the same. This is
especially true when trying to deploy CTFNote with a previously-existing
database.

This commit removes the hardcoded values and replaces them with DB_HOST/DB_PORT.

Upstream commit: TFNS@9606303
Upstream PR: TFNS#235

API needs to wait for the database to be up before starting.

We do not know how long it takes: just because the container is started doesn't
mean that Postgres is ready. The workaround is to use a small script (start.sh)
that waits until a connection to the database can be done before passing the
execution to yarn.

The Dockerfile contains hardcoded values for the database's hostname and ports,
but there is no guarantee that these values are always the same. This is
especially true when trying to deploy CTFNote with a previously-existing
database.

This commit removes the hardcoded values and replaces them with DB_HOST/DB_PORT.

Upstream commit: TFNS@9606303
@JJ-8 JJ-8 merged commit 927be31 into main Mar 8, 2024
2 checks passed
@JJ-8 JJ-8 deleted the 234-use-dbhost-variable branch March 8, 2024 18:17
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.

2 participants