I have a problem with Spring Boot and Docker compose.
I am developing a deployable e-commerce site having a docker image as an option as well.
Where is the problem? When I start the application via the ide, spring boot processes the docker compose file and tries to connect all the services. But the spring-store-docker service fails saying it can't connect to port 8080; this it does with all ports, not just 8080.
What I tried? - Stop the postgresql service through systemctl. - Disable the firewall. - Change port both side. - Factory reset docker.
Below is my compose.yaml file: ``` services: spring-store-docker: build: . environment: - 'SPRING_APPLICATION_NAME=springstore' - 'SPRING_DATASOURCE_URL=jdbc:postgresql://postgres/webstore' - 'SPRING_DATASOURCE_USERNAME=springuser' - 'SPRING_DATASOURCE_PASSWORD=boot' - 'SPRING_DATASOURCE_TOMCAT_MAX-WAIT=10000' - 'SPRING_DATASOURCE_TOMCAT_MAX-ACTIVE=50' - 'SPRING_DATASOURCE_TOMCAT_TEST-ON-BORROW=true' - 'SPRING_LIQUIBASE_CHANGE-LOG=classpath:db/changelog/db.changelog-master.xml' ports: - '8080:8081'
postgres:
image: 'postgres:latest'
environment:
- 'POSTGRES_DB=webstore'
- 'POSTGRES_PASSWORD=boot'
- 'POSTGRES_USER=springuser'
ports:
- '5432'
```In the output console, I get:
``` Suppressed: org.springframework.boot.docker.compose.lifecycle.ServiceNotReadyException: IOException while connecting to port 8080 ```
and
``` Caused by: java.net.ConnectException: Connection refused```