XYBotV2-core/Dockerfile
lxh 3fde6db7a0
Some checks failed
BuildImage / build-image (push) Failing after 1m18s
🐛 fix a bug.
2025-02-17 15:09:21 +08:00

40 lines
1.2 KiB
Docker

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
LABEL org.opencontainers.image.authors="lxh@cxh.cn"
# 预定义参数
ENV TZ="Asia/Shanghai"
# 设置时区和安装Redis
RUN apk add --no-cache tzdata redis-server && \
cp /usr/share/zoneinfo/${TZ} /etc/localtime && \
echo "${TZ}" > /etc/timezone && \
rm -rf /var/lib/apt/lists/*
# 设置工作目录
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"]