From 59db28f3c967a7ffc1267feb55007307c90f958d Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 16 May 2022 10:04:08 +0200 Subject: [PATCH] re-add entrypoint.sh --- Dockerfile | 11 ++++++++--- entrypoint.sh | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 6a9eb00..8d7bc91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,14 +41,19 @@ COPY recorder.conf /config/recorder.conf COPY JSON.lua /config/JSON.lua COPY --from=builder /app / -COPY recorder-health.sh /usr/local/sbin/recorder-health.sh +COPY recorder-health.sh /usr/sbin/recorder-health.sh +COPY entrypoint.sh /usr/sbin/entrypoint.sh # If you absolutely need health-checking, enable the option below. Keep in # mind that until https://github.com/systemd/systemd/issues/6432 is resolved, # using the HEALTHCHECK feature will cause systemd to generate a significant # amount of spam in the system logs. -# HEALTHCHECK CMD /usr/local/sbin/recorder-health.sh +# HEALTHCHECK CMD /usr/sbin/recorder-health.sh EXPOSE 8083 -ENTRYPOINT ["/usr/sbin/ot-recorder"] +ENV OTR_CAFILE=/etc/ssl/cert.pem +ENV OTR_STORAGEDIR=/store +ENV OTR_TOPIC="owntracks/#" + +ENTRYPOINT ["/usr/sbin/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..294aaae --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +if ! [ -f ${OTR_STORAGEDIR}/ghash/data.mdb ]; then + ot-recorder --initialize +fi + +ot-recorder ${OTR_TOPIC}