FROM ghcr.io/home-assistant/base:2026.10.1

RUN apk add --no-cache python3 py3-pip

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --break-system-packages -r requirements.txt

COPY app/ /app/
COPY run.sh /run.sh
RUN chmod a+x /run.sh

LABEL \
    io.hass.name="MQTT Certificate Manager" \
    io.hass.type="addon" \
    io.hass.arch="amd64"

CMD ["/run.sh"]
