# Runtime image using locally cross-compiled linux/amd64 binaries (avoids QEMU segfault in buildx).
ARG IMAGE_PREFIX=docker.1panel.live/library/
ARG APK_MIRROR=mirrors.aliyun.com
FROM ${IMAGE_PREFIX}alpine:3.20 AS runtime
ARG APK_MIRROR=mirrors.aliyun.com
RUN sed -i "s/dl-cdn.alpinelinux.org/${APK_MIRROR}/g" /etc/apk/repositories \
    && apk add --no-cache ca-certificates tini

ENV LUMINARY_DATA=/data \
    LUMINARY_ADDR=:8293

COPY .docker-bin/luminary /usr/local/bin/luminary
COPY .docker-bin/luminary-recover /usr/local/bin/luminary-recover
COPY docker/entrypoint.sh /entrypoint.sh
COPY scripts/luminary-recover.sh /usr/local/bin/luminary-recover.sh
RUN chmod +x /entrypoint.sh /usr/local/bin/luminary-recover.sh

VOLUME ["/data"]
EXPOSE 8293
ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
