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

Fix Make Postgres on Docker #8830

Merged
merged 1 commit into from
Dec 2, 2024
Merged

Conversation

FelixMalfait
Copy link
Member

Fixes #8630

@FelixMalfait FelixMalfait merged commit 39a9cd0 into main Dec 2, 2024
12 checks passed
@FelixMalfait FelixMalfait deleted the fix-make-postgres-on-docker branch December 2, 2024 08:58
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR modifies the Makefile to fix PostgreSQL initialization hanging issues by executing commands directly within the Docker container context instead of through the host machine.

  • Modified postgres-on-docker target in /Makefile to execute psql commands directly inside container using docker exec twenty_pg
  • Removed host connection parameters (-h localhost, -p 5432) since commands now run inside container
  • Removed PGPASSWORD environment variable as authentication happens within container context
  • Added container readiness check using pg_is_in_recovery() to ensure proper initialization

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +11 to 14
@until docker exec twenty_pg psql -U postgres -d postgres \
-c 'SELECT pg_is_in_recovery();' 2>/dev/null | grep -q 'f'; do \
sleep 1; \
done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider adding a timeout to prevent infinite waiting if PostgreSQL fails to start properly

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.

macOS - make postgres-on-docker hangs on "Waiting for PostgreSQL to be ready..."
1 participant