Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2203

Java Application can not connect to redis when running on docker

$
0
0

I have the following docker compose file:

  GNU nano 6.2                                                                                        docker-compose.yml                                                                                                  version: '3'services:  urgent-fury-pre-prod:    image: leonhard8/urgent-fury:latest    depends_on:      - redis    restart: always    ports:     - '1:1'    networks:      - external    environment:      stage: "pre-prod"    deploy:      replicas: 1      restart_policy:        condition: on-failure  redis:    image: "redis:alpine"    restart: always    ports:      - '6379:6379'    networks:      - externalnetworks:  external:    external: true

I use Redis using Java Jedis.

final Jedis jedis = new Jedis();

However everytime I try to run docker-compose the connection times out.

  • Google the issue
  • Ask ChatGPT multiple times
  • Read the docker documentation

Viewing all articles
Browse latest Browse all 2203

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>