I am trying to do request on http://localhost:8080/actuator/health
to check if everything is UP.
When communication is between locally run JAVAAPP -> REDIS in docker container the status is UP.
But when communication is between dockereized JAVAAPP -> REDIS in docker container the status is DOWN
"redis": {"status": "DOWN","details": {"error": "org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis" } }
application.properties has :
spring.redis.host=redisspring.redis.port=6379
docker-compose:
version: "3.9"services: JAVAPP: container_name: JAVAPP image: JAVAPP:latest ports: - "8080:8080" redis: container_name: redis image: redis:6.0 restart: always ports: - "6379:6379"
I tried do add env variables in dockerfile and in docker-compose.
Do you have any ideas why is it working locally but not between containers?