# ///
# Dockerfile
# 描述：WXAuto Center Docker 镜像构建文件
# 作者：AI Generated
# 创建日期：2026-04-05
# ///

FROM python:3.11-slim

WORKDIR /app

RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
    apt-get update && apt-get install -y --no-install-recommends \
    curl \
    tzdata \
    && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt .

RUN pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt

COPY main.py .
COPY config.py .
COPY config.json .
COPY models.py .
COPY database_service.py .
COPY run.py .
COPY api ./api
COPY services ./services
COPY utils ./utils
COPY plugins ./plugins
COPY static ./static

RUN mkdir -p /app/logs /app/plugins/custom

ENV PYTHONUNBUFFERED=1
ENV TZ=Asia/Shanghai

EXPOSE 8080

CMD ["python", "main.py"]
