3

I have a small spring boot web application which saves the data to redis.

After running docker-compose.yml containers are started but on localhost:8085 i have "The connection was reset".

spring boot aplication.yml

server:
    address: 127.0.0.1
---
spring:
    profiles: development
server:
    address: 127.0.0.1
---
spring:
    profiles: production
server:
    address: 127.0.0.1

docker-compose.yml

web:
  build: docker_app
  ports:
   - "8085:8080"
  links:
   - redis

redis:  
    image: redis

How do I link spring boot and redis?

What did I miss?

1 Answer 1

3

127.0.0.1 is the wrong address. Use redis as the hostname.

Sign up to request clarification or add additional context in comments.

1 Comment

You are right. I can't use address 127.0.0.1 in docker and redis as hostname works.

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.