Skip to content

allow docker-entrypoint postgres startup to listen on tcp as well as unix sockets #532

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

Closed
wants to merge 1 commit into from

Conversation

dmepham
Copy link

@dmepham dmepham commented Nov 29, 2018

No description provided.

@yosifkit
Copy link
Member

Not listening for outside connections during initialization is on purpose (#75, and #440). There would be no way for the temporary postgres server to know when outside connections are done. These outside connections should just wait for the startup to complete (ie, the postgres port is ready to accept connections) or be run through scripts in /docker-entrypoint-initdb.d/.

@yosifkit yosifkit closed this Nov 30, 2018
@dmepham
Copy link
Author

dmepham commented Dec 5, 2018

@yosifkit sorry, I actually raised this PR by accident. Thanks for the helpful background info.

My original intention was to apply database initialization by putting a shell script in /docker-entrypoint-initdb.d/, which would in turn run a liquibase command to apply database updates. But because liquibase uses the JDBC to connect to the database, and JDBC requires connection via tcp, the /docker-entrypoint-initdb.d/ and liquibase (or any initialization process using JDBC) can't be used together.

After reading your comments here and a comment here, it looks like the best solutions may either:

  1. Applying liquibase updates after the docker container is starter and the database is listening on tcp, or,
  2. Restarting the temporary database in a script within /docker-entrypoint-initdb.d/, and then applying liquibase updates. As you noted, this may present issues with health checks.

This comment and PR are probably more suited to a comment on an existing issue or PR, but I wanted to drop it here anyway for the record. Thanks for the help.

@dmepham dmepham deleted the dev-PLAN-76 branch December 5, 2018 21:49
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