Files
abot/Dockerfile
liuwei 9589846113 完善 Docker 部署骨架并整理开源发布资料
- 调整 Dockerfile 与入口脚本,拆分应用、MySQL、Redis 的部署职责
- 新增 docker-compose、docker ignore 与 Docker 环境变量示例
- 重写 README 并补充 Docker 部署说明与第三方资产说明
- 将后台示例账号与 webhook token 改为安全占位值,移除弱口令默认兜底
2026-05-06 14:44:49 +08:00

62 lines
1.8 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM python:3.11-slim
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
TZ=Asia/Shanghai
# 仅保留 ABOT 运行所需的系统依赖:
# 1. 不再在应用镜像中内置 MariaDB / Redis避免单容器承载过多职责
# 2. 生产部署交由 docker-compose 管理独立基础设施服务;
# 3. 补充常用字体依赖,降低图片生成与渲染场景中的缺字风险。
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
bash \
tzdata \
ffmpeg \
libgl1 \
libglib2.0-0 \
fonts-noto-cjk \
fonts-noto-color-emoji \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY . /app
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# 统一使用 ABOT_* 命名作为默认环境变量前缀:
# 1. 与 config.example.yaml 保持一致,降低新用户理解成本;
# 2. WECHAT_* 继续用于生成 wechat_ipad/config.toml
# 3. 默认值仅用于容器首次启动兜底,正式环境建议在 .env 中显式配置。
ENV ABOT_ENVIRONMENT=production \
ABOT_PLUGIN_DIR=plugins \
ABOT_DB_HOST=127.0.0.1 \
ABOT_DB_PORT=3306 \
ABOT_DB_NAME=message_archive \
ABOT_DB_USER=root \
ABOT_DB_PASSWORD= \
ABOT_REDIS_HOST=127.0.0.1 \
ABOT_REDIS_PORT=6379 \
ABOT_REDIS_DB=0 \
ABOT_REDIS_PASSWORD= \
WECHAT_SERVER_URL=http://127.0.0.1:8059/ \
WECHAT_SERVER_IP=127.0.0.1 \
WECHAT_SERVER_PORT=8059 \
WECHAT_WXID= \
WECHAT_DEVICE_NAME=ABOTPad \
WECHAT_DEVICE_ID= \
DASHBOARD_HOST=0.0.0.0 \
DASHBOARD_PORT=8888
EXPOSE 8888
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["python", "main.py"]