FROM rust:1-bookworm

WORKDIR /usr/src/historian
COPY . .

RUN cargo install --path .

ENV PLUGIN_INPUT=.
ENV PLUGIN_OUTPUT=output
CMD historian $PLUGIN_INPUT --template-path /usr/src/historian/templates --render-to /tmp/historian-output && cp -R /tmp/historian-output $PLUGIN_OUTPUT
