I created a quarkus application with access to a postgresql database on localhost. After creating the native image I try to run the application with:
docker run -i --rm -p 8080:8080 quarkusimage
if I try a method with postman I have this result:
addEmployee Hibernate: select nextval ('quarkus.hibernate_sequence') 2020-06-18 20: 43: 38,214 WARN [io.agr.pool] (Agroal_20041415421) Datasource '': Connection to localhost: 5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP / IP connections.
if i try to run the application with
docker run --net = "host" -i --rm -p 8080:8080 quarkusimage
the application accesses the database on localhost, but if I try a postman call it can't reach the service.
What am I doing wrong?
Thank you