FROM python:3.12-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    TZ=Asia/Shanghai

WORKDIR /app

RUN apt-get update \
    && apt-get install -y --no-install-recommends tzdata \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY daily/ daily/
COPY shared/ shared/
COPY skills/ skills/
COPY config/ config/
COPY run-daily.sh .

RUN chmod +x run-daily.sh \
    && mkdir -p output .cache logs

VOLUME ["/app/output", "/app/.cache", "/app/logs"]

ENTRYPOINT ["./run-daily.sh"]
