docker-compose 部署单节点redis
1. docker-compose文件准备
- docker-compose-kpi.yml
version: "3.2"
services:
redis:
image: redis:6
container_name: redis
hostname: redis
restart: always
command: redis-server --requirepass redis123456 --appendonly yes
ports:
- "16379:6379"
environment:
TZ: "Asia/Shanghai"
volumes:
- redis-data:/data
deploy:
resources:
limits: # 资源使用上限
cpus: "1"
memory: 1G
volumes:
redis-data:
2. 部署
docker-compose -f docker-compose-kpi.yml up -d
标签:compose,部署,redis,docker,data,节点
From: https://www.cnblogs.com/JentZhang/p/17216193.html