redis.yml
version: “3”
services:
redis:
container_name: redis-1
image: docker.io/redis
ports:
- “6379:6379”
volumes:
- /opt/redis/conf:/conf
command: “/usr/local/bin/redis-server /conf/redis.conf”
#entrypoint: /usr/local/bin/redis-server /conf/redis.conf
redis.conf
遇到一个坑
daemonize no 默认情况下,redis不是在后台运行的,如果需要在后台运行,把该项的值更改为yes
daemonize yes
需要把这个配置注释才起得来(怀疑和docker容器也是daemon模式冲突了)
本文探讨在Docker容器中运行Redis时遇到的问题,即默认配置下Redis不在后台运行,需要修改配置文件中的daemonize参数为yes。文章强调,在使用Docker部署Redis时,必须注释掉配置文件中可能导致冲突的设置。
1480





