# Use a base image available for a few architectures
FROM debian:testing-slim

RUN apt-get update && apt-get --yes upgrade && \
    apt-get --yes install jq curl

# This installs dsc. Another possibility is to extend FROM the dsc docker image
RUN curl -sSLO https://github.com/docspell/dsc/releases/download/nightly/dsc_amd64-musl-nightly && \
    cp dsc_amd64-musl-nightly /usr/local/bin/dsc && \
    chmod 755 /usr/local/bin/dsc

# Installs the addon. For this one, only the script is needed and no
# build step is required
RUN mkdir -p /opt/addon
COPY src/addon.sh /opt/addon/
RUN chmod 755 /opt/addon/addon.sh

# Using the entrypoint, docspell doesn't need to know where the
# executable is and can just give additional arguments.
ENTRYPOINT [ "/opt/addon/addon.sh" ]
