1

Each time my Quarkus app restarts it has a different Postgres port. There is testcontainers.reuse.enable=false in the ~/.testcontainers.properties. MacOS, run from Idea.

1 Answer 1

1

Setting

quarkus.datasource.devservices.port=5432

in your application.properties should do the trick. Obviously, setting a fixed port creates the risk of port conflicts. What is it you need the fixed port for? The Dev UI should give you some access to the database admin, and CDI injection should allow your code to access a client without needing to hardcode in a port.

Sign up to request clarification or add additional context in comments.

3 Comments

just to connect IDE to pg at dev stage, not in production
Ah, if you want to use the IDE to connect to it, rather than the Quarkus dev UI, that would be easier with a fixed port. If there's things you can do through an IDE that you can't do through the dev UI, it's worth raising a Quarkus feature request.
I am new to Quarkus, maybe there is a way to open Postgres console or look through a database structure. And I used to DBeaver or Idea internal db tool… So fixed pg port would be useful on my opinion. In my current configuration (according to the advice above) I use port 54320.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.