0
   ** Application.properties**
    
spring.datasource.url=jdbc:postgresql://0.0.0.0:8000/dockerDb
spring.datasource.password=somePassword
spring.jpa.show-sql=true 
spring.jpa.hibernate.ddl-auto=create

** docker ps** CONTAINER ID 1506c2981b1d IMAGE 13-version
COMMAND "docker-entrypoint.s…"
PORTS 5432/tcp, 0.0.0.0:8000->5438/tcp
NAMES postgresql-13

1 Answer 1

0

The 0.0.0.0 in the docker ps command means that any address can connect to the container. But you need to use a real IP address or machine name. As it's on the same computer, localhost will be fine:

spring.datasource.url=jdbc:postgresql://localhost:8000/dockerDb
Sign up to request clarification or add additional context in comments.

Comments

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.