# syntax=docker/dockerfile:1

FROM docker:27-cli

RUN apk add --no-cache bash curl jq coreutils

WORKDIR /updater

COPY entrypoint.sh /updater/entrypoint.sh
COPY targets.json.example /etc/updater/targets.json

RUN chmod +x /updater/entrypoint.sh

ENV TARGETS_FILE=/etc/updater/targets.json
ENV STATE_FILE=/state/updater-state.json
ENV POLL_INTERVAL_SECONDS=300
ENV HEALTH_TIMEOUT_SECONDS=120
ENV STOP_TIMEOUT_SECONDS=30
ENV REGISTRY=git.shx.one

VOLUME ["/state"]

ENTRYPOINT ["/updater/entrypoint.sh"]
