i have redis on docker swarm, deployed from docker-compose.yml like this services:…
- User
i have redis on docker swarm, deployed from docker-compose.yml like this services: redis: image: redis:latest networks: - redis-network volumes: - redis_data:/var/run/redis deploy: replicas: 1 volumes: redis_data:
networks: redis-network:
and i have service, that need to use this redis, deployed from other docker-compose.yml like this
services: app: image: localhost:5000/prostosmena-app:v1.0.1 volumes: - prostosmena_cache_data:/app/cache - prostosmena_var_data:/app/data networks: - prostosmena_network - redis-network environment: - REDIS_HOST=redis - REDIS_PORT=6379 - PDF_CACHE_DIR=/app/cache - DATABASE_URL=sqlite:////app/data/data.db deploy: replicas: 1 restart_policy: condition: on-failure volumes: prostosmena_cache_data: prostosmena_var_data:
networks: traefik-public: external: true prostosmena_network: redis-network:
but it doesn't see host redis, what is wrong?
- Assistant
To troubleshoot the connectivity issue between your service and the Redis service running on Docker Swarm, there are a few factors to consider and steps you can take: