diff --git a/Dockerfile b/Dockerfile index ecc56ab..76d34e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,39 +1,21 @@ -FROM python:3.11-slim AS core - -RUN pip install --no-cache-dir xywechatpad-binary -RUN pip show xywechatpad-binary - - -FROM debian:bookworm-slim AS runner +FROM debian:bookworm-slim LABEL org.opencontainers.image.authors="lxh@cxh.cn" # 预定义参数 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 # 复制文件 COPY . . COPY --from=core /usr/local/lib/python3.11/site-packages/xywechatpad_binary/binaries/linux_x64 ./WechatAPI/core/ -#RUN ls -lah ./WechatAPI/core - -# 授权脚本可执行 -RUN chmod +x entrypoint.sh # 开始运行 -#CMD ["/app/WechatAPI/core/XYWechatPad-linux-x86", "--port", "${PORT}", "--mode", "${MODE}", "--redis-host", "${REDIS_HOST}", " --redis-port", "${REDIS_PORT}", "--redis-password", "${REDIS_PASSWORD}", "--redis-db", "${REDIS_DB}"] -#CMD /app/WechatAPI/core/XYWechatPad \ -# --port $PORT \ -# --mode $MODE \ -# --redis-host $REDIS_HOST \ -# --redis-port $REDIS_PORT \ -# --redis-password $REDIS_PASSWORD \ -# --redis-db $REDIS_DB -CMD ["./entrypoint.sh"] +CMD /app/WechatAPI/core/XYWechatPad \ + -p $PORT \ + -m $MODE \ + -rh $REDIS_HOST \ + -rp $REDIS_PORT \ + -rpwd $REDIS_PASSWORD \ + -rdb $REDIS_DB diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index c05a694..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# 启动Redis服务 -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/readme.md b/readme.md index 5bbc2b9..0b12986 100644 --- a/readme.md +++ b/readme.md @@ -44,3 +44,4 @@ graph TB 版本 | 日志 ---|--- 20250217 | fix: 发送视频报错,视频消息不应该堵塞。 +20250220 | fix: 修复无法设置 Redis 的 BUG。