diff --git a/Dockerfile b/Dockerfile index 42249c4..a0963de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ FROM alpine:3.18 WORKDIR /root -RUN apk add --no-cache ca-certificates +RUN apk add --no-cache ca-certificates busybox-extras COPY --from=builder /app/cmd/backup/backup /usr/bin/backup COPY --chmod=755 ./entrypoint.sh /root/ diff --git a/entrypoint.sh b/entrypoint.sh index edbf6c9..2ecd7a1 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,5 +22,12 @@ else done fi +if [ ! -z "$SERVE_METRICS_PATH" ]; then + mkdir -p /var/www/html${SERVE_METRICS_PATH} + echo "ok" > /var/www/html${SERVE_METRICS_PATH}/metrics.txt + httpd -h /var/www/html -p "${SERVE_METRICS_PORT:-80}" + echo "Serving metrics on port ${SERVE_METRICS_PORT:-80}." +fi + echo "Starting cron in foreground." crond -f -d 8