I'm new to docker-compose, wanted to run a container with Postgres db in it. For this I've created a docker-compose.yml with the following content:
services:
postgresql:
image: postgres
container_name: postgres_db
ports:
- "5433:5433"
environment:
- POSTGRES_PASSWORD=admin
- POSTGRES_USER=postgres
- POSTGRES_DB=testdb
So far I didn't pack my Spring Boot app in a container as well, as I'd like to do it step by step and for now run only the database in container.
I start it with
docker-compose -f docker-compose.yml up, then I run my app in Intellij and see that in logs:
org.postgresql.util.PSQLException: The connection attempt failed. Caused by: java.io.EOFException: null
Via
docker-exec I was able to connect to my testdb. However, in Intellij I can't do the same via Database tool, I keep getting authentication error (username/password are wrong).
I'm struggling with these new concepts. What am I missing here?