From 1370d4a43c482eb02df63e6e02195f2dc6baa0f0 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期一, 30 八月 2021 14:18:22 +0800
Subject: [PATCH] add 优化 增加 redis 配置文件
---
docker/docker-compose.yml | 6 +++---
docker/deploy.sh | 7 ++++++-
docker/redis/redis.conf | 2 ++
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/docker/deploy.sh b/docker/deploy.sh
index 79fb9ae..28822ec 100644
--- a/docker/deploy.sh
+++ b/docker/deploy.sh
@@ -22,11 +22,16 @@
##鏀剧疆鎸傝浇鏂囦欢
mount(){
- #鎸傝浇閰嶇疆鏂囦欢
+ #鎸傝浇 nginx 閰嶇疆鏂囦欢
if test ! -f "/docker/nginx/conf/nginx.conf" ;then
mkdir -p /docker/nginx/conf
cp nginx/nginx.conf /docker/nginx/conf/nginx.conf
fi
+ #鎸傝浇 redis 閰嶇疆鏂囦欢
+ if test ! -f "/docker/redis/conf/redis.conf" ;then
+ mkdir -p /docker/redis/conf
+ cp redis/redis.conf /docker/redis/conf/redis.conf
+ fi
}
#鍚姩鍩虹妯″潡
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index baac56a..b6e43fa 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -65,10 +65,10 @@
TZ: Asia/Shanghai
volumes:
# 閰嶇疆鏂囦欢
- - /docker/redis/conf/redis.conf:/redis.conf:rw
+ - /docker/redis/conf:/redis/config:rw
# 鏁版嵁鏂囦欢
- - /docker/redis/data:/data:rw
- command: "redis-server --appendonly yes"
+ - /docker/redis/data:/redis/data:rw
+ command: "redis-server /redis/config/redis.conf --appendonly yes"
privileged: true
restart: always
networks:
diff --git a/docker/redis/redis.conf b/docker/redis/redis.conf
new file mode 100644
index 0000000..213e9ba
--- /dev/null
+++ b/docker/redis/redis.conf
@@ -0,0 +1,2 @@
+# redis 瀵嗙爜
+# requirepass 123456
\ No newline at end of file
--
Gitblit v1.9.3