Run httpd server in container if requested

This commit is contained in:
Frederik Ring 2023-08-04 13:49:58 +02:00
parent 1c6f64e254
commit f4138fd733
2 changed files with 8 additions and 1 deletions

View File

@ -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/

View File

@ -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