mirror of
https://git.cloudron.io/cloudron/prometheus-server-app.git
synced 2025-02-15 09:05:14 +00:00
25 lines
795 B
Bash
Executable file
25 lines
795 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
mkdir -p /app/data/runtime /app/data/config
|
|
|
|
if [[ ! -f /app/data/config/prometheus.yml ]]; then
|
|
echo "=> Creating config file on first run"
|
|
cp /app/code/prometheus.yml /app/data/config/prometheus.yml
|
|
fi
|
|
|
|
chown -R cloudron:cloudron /app/data
|
|
|
|
[[ -f /app/data/prometheus_variables.sh ]] && mv /app/data/env.sh
|
|
|
|
if [[ ! -f /app/data/env.sh ]]; then
|
|
echo "=> Copy default env.sh"
|
|
cp /app/pkg/env.sh.template /app/data/env.sh
|
|
fi
|
|
|
|
echo "=> Source custom variables"
|
|
source /app/data/env.sh
|
|
|
|
echo "=> Starting Prometheus with retention time of $retention_time"
|
|
exec /usr/local/bin/gosu cloudron:cloudron /app/code/prometheus --config.file=/app/data/config/prometheus.yml --storage.tsdb.path=/app/data/runtime --storage.tsdb.retention.time="${retention_time:-15d}"
|