Files
PolyWeather/Dockerfile
T

29 lines
645 B
Docker
Raw Normal View History

FROM python:3.11-slim
# 设置工作目录
WORKDIR /app
# 设置环境变量
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_ROOT_USER_ACTION=ignore \
TZ=UTC
# 安装系统依赖 (netCDF4 需要 HDF5 + 编译工具)
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libhdf5-dev libnetcdf-dev && \
rm -rf /var/lib/apt/lists/*
# 复制 requirements 文件
COPY requirements.txt .
# 安装 Python 依赖
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
# 复制项目代码
COPY . .
# 启动机器人
CMD ["python", "bot_listener.py"]