For unknown reasons my docker container doesn't launch Spring Boot application even if in properties I show path to postgres-container:
spring.datasource.url=jdbc:postgresql://postgres-container/maitinimas02
I built an image docker build -t back-end:1 .
And launched the container: winpty docker run -it --network db-network -p 8080:8080 back-end:1
but I still have an error:
2023-03-22 14:21:40.005 ERROR 7 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:331) ~[postgresql-42.3.5.jar!/:42.3.5]
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.3.5.jar!/:42.3.5]
//....
Caused by: java.net.UnknownHostException: postgres-container
Do you know how to launch the container?
postgress-container is running on Docker-Desktop with explicitly mapped ports 5432:5432.