docker 部署redis
配置文件部分
$ vim redis.conf
bind *
protected-mode yes
requirepass 111111
port 6379
tcp-backlog 511
timeout 300
tcp-keepalive 300
#是否守护进程
daemonize no
#pid
pidfile /data/redis_6379.pid
#日志
loglevel verbose
logfile ""
#数据库个数
databases 16
#保存
save 900 1
save 300 10
save 60 10000
rdbcompression yes
rdbchecksum yes
#数据文件
dbfilename dump.rdb
dir /data
资源清单文件
---
version: '3'
services:
redis:
image: redis:7
container_name: redis
ports:
- 6379:6379
restart: always
volumes:
- ./data:/data
- /etc/localtime:/etc/localtime
- ./redis.conf:/usr/local/etc/redis/redis.conf
command:
- /usr/local/etc/redis/redis.conf
部署
docker compose up -d
本文来自博客园,作者:厚礼蝎,转载请注明原文链接:https://www.cnblogs.com/guangdelw/p/17114589.html