prometheus-server-app/start.sh
Girish Ramakrishnan 059fc273f1 Remove docker/ directory
this brings it in line with other packages
2022-03-08 09:32:27 -08:00

23 lines
837 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
if [[ ! -f /app/data/prometheus_variables.sh ]]; then
echo "=> Copy default prometheus variable file since it does not exist"
cp /app/pkg/default_prometheus_variables.sh /app/data/prometheus_variables.sh
fi
echo "=> Source custom variables"
source /app/data/prometheus_variables.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}"