This commit is contained in:
2026-04-08 11:00:31 +08:00
parent fb21a127b5
commit 7019cf180d
17 changed files with 960 additions and 1 deletions

23
wechat-bot/Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM python:3.12-slim
WORKDIR /wechat-bot
# 安装系统依赖
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc curl && \
rm -rf /var/lib/apt/lists/*
# 安装 Python 依赖(利用 Docker 层缓存)
COPY requirements.txt .
RUN pip install --no-cache-dir --break-system-packages -r requirements.txt
# 复制项目代码
COPY config.py .
COPY main.py .
COPY bot/ ./bot/
# 环境变量
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
CMD ["python", "main.py"]