FROM python:3.12-slim-bookworm
WORKDIR /app
COPY app.py .
RUN pip install --no-cache-dir trafilatura==2.2.0 'curl_cffi==0.13.0' \
    || pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple trafilatura==2.2.0 'curl_cffi==0.13.0'
EXPOSE 8080
CMD ["python", "-u", "app.py"]
