diff --git a/Dockerfile b/Dockerfile index eb4598e..dff76a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,4 +16,6 @@ RUN apt update && apt install -y curl tar \ && mv resvg /usr/local/bin/resvg \ && chmod +x /usr/local/bin/resvg COPY --from=builder /app/svg-templater /usr/local/bin/svg-templater -CMD ["svg-templater"] +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..989443b --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +CMD="svg-templater" + +if [ -n "$API_KEY" ]; then + CMD="$CMD --frontendkey $API_KEY" +fi + +if [ -n "$DATA_DIR" ]; then + CMD="$CMD --data $DATA_DIR" +fi + +eval exec $CMD "$@" \ No newline at end of file