Answer the question
In order to leave comments, you need to log in
Container can't access redis host?
bot:
restart: always
network_mode: bridge
build:
context: .
dockerfile: dockerfile
depends_on:
- cache
cache:
image: redis:6.2-alpine
restart: always
command: redis-server --save 20 1 --loglevel warning --requirepass [email protected] --loglevel warning
ports:
- 6379:6379
volumes:
- cache:/data
Answer the question
In order to leave comments, you need to log in
Решил короче так, добавил
links:
- cache:host.docker.cache
в container bot
Укажи имя, а не IP адрес. В твоём случае имя будет cache
127.0.0.1 - вообще нет смысла использовать, так как у каждого контейнера свой loopback интерфейс.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question