# music chord-fetcher sidecar
# 抓 yopu.co 截图的 selenium 服务，跟 music 主容器同 pod 共享 PVC。

FROM python:3.11-slim-bookworm

RUN apt-get update && apt-get install -y --no-install-recommends \
    chromium chromium-driver fonts-noto-cjk ca-certificates \
    && rm -rf /var/lib/apt/lists/*

ENV CHROME_BIN=/usr/bin/chromium
ENV CHROMEDRIVER_PATH=/usr/bin/chromedriver
ENV PYTHONUNBUFFERED=1

RUN pip install --no-cache-dir \
    selenium==4.27.1 \
    pillow==11.0.0 \
    fastapi==0.115.6 \
    uvicorn==0.34.0

WORKDIR /app
COPY yopu.py chord_server.py ./

EXPOSE 8001
CMD ["uvicorn", "chord_server:app", "--host", "0.0.0.0", "--port", "8001"]
