From 5dcdc7dbbd0df468dce3560fcb3da7e0c72ebd72 Mon Sep 17 00:00:00 2001 From: lxh Date: Tue, 18 Feb 2025 08:58:55 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96redis=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 ++ entrypoint.sh | 2 +- redis.conf | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 redis.conf diff --git a/Dockerfile b/Dockerfile index 24b8771..ecc56ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,8 @@ ENV TZ="Asia/Shanghai" # 安装Redis RUN apt-get update && apt-get install -y redis-server && \ rm -rf /var/lib/apt/lists/* +# 复制 Redis 配置 +COPY redis.conf /etc/redis/redis.conf # 设置工作目录 WORKDIR /app diff --git a/entrypoint.sh b/entrypoint.sh index 675fb0b..c05a694 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/bash # 启动Redis服务 -service redis-server start +redis-server /etc/redis/redis.conf --daemonize yes # 执行主程序 /app/WechatAPI/core/XYWechatPad --port 9000 --mode release --redis-host 127.0.0.1 --redis-port 6379 --redis-password "" --redis-db 0 diff --git a/redis.conf b/redis.conf new file mode 100644 index 0000000..e3824a4 --- /dev/null +++ b/redis.conf @@ -0,0 +1,4 @@ +dir /var/lib/redis +save 60 1000 +appendonly yes +appendfsync everysec