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模式冲突了)