dashboard-nanobot/bot-images/Dashboard.Dockerfile

32 lines
1.0 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PYTHONIOENCODING=utf-8
# 1. 替换 Debian 源为国内镜像
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources && \
sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources
# 2. 安装基础依赖
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# 3. 安装 aiohttp 和基础 python 工具
RUN python -m pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ --upgrade \
pip setuptools wheel aiohttp
WORKDIR /app
# 这一步会把您修改好的 nanobot/channels/dashboard.py 一起拷进去
COPY . /app
# 4. 安装 nanobot包含 WeCom 渠道依赖)
RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ ".[wecom]"
WORKDIR /root
# 官方 gateway 模式,现在它会自动加载您的 DashboardChannel
CMD ["nanobot", "gateway"]