FROM alpine:3.20

ARG VERSION

LABEL version="${VERSION}" \
    Maintainer="H2 invent GmbH" \
    Description="Meetling Livekit Recording Uploader" \
    org.opencontainers.version="${VERSION}" \
    org.opencontainers.image.title="Meetling Livekit Recording Uploader" \
    org.opencontainers.image.license="AGPLv3" \
    org.opencontainers.image.vendor="H2 invent GmbH" \
    org.opencontainers.image.authors="Andreas Holzmann <support@h2-invent.com>" \
    org.opencontainers.image.source="https://github.com/h2-invent/jitsi-admin" \
    org.opencontainers.image.documentation="https://meetling.de" \
    org.opencontainers.image.url="https://meetling.de"

COPY inotify.sh /inotify.sh

RUN mkdir /out \
    chmod +x /inotify.sh \
    chown -R nobody /out

RUN apk --no-cache add \
    inotify-tools \
    curl \
    coreutils \
    && rm -rf /var/cache/apk/*

USER nobody

ENV CHUNK_SIZE=1048576 \
    UPLOAD_URL=http://localhost:8000/recording/upload \
    AUTH_TOKEN=verySecretToken

CMD ["sh", "/inotify.sh" ]