version: '3.8'
services:
redis:
container_name: redis
image: redis:latest
restart: always
environment:
TZ: Asia/Shanghai
ports:
- "6379:6379"
volumes:
- /docker_data/redis/conf/:/etc/redis/
- /docker_data/redis/data:/data
- /etc/localtime:/etc/localtime:ro
command: ["redis-server","/etc/redis/redis.conf"]
networks:
default:
external: true
name: my_network
# 配置文件请自行官网下载
# 监听 IP
# bind
# 保护模式,本地连接
# protected-mode no
# 端口
# port 6379
# 守护进程
# daemonize no
# 密码
# requirepass 123456
# 持久化
# appendonly yes
Redis Docker Compose 配置文件
最新推荐文章于 2024-06-04 12:58:13 发布