mirror of
https://git.cloudron.io/cloudron/prometheus-server-app.git
synced 2024-12-27 09:30:33 +00:00
rename to env.sh
This commit is contained in:
parent
cf53245bff
commit
7fe4cf6fb2
3 changed files with 7 additions and 5 deletions
|
@ -7,6 +7,6 @@ ARG VERSION=2.43.0
|
|||
|
||||
RUN curl -L https://github.com/prometheus/prometheus/releases/download/v${VERSION}/prometheus-${VERSION}.linux-amd64.tar.gz | tar zxvf - --strip-components 1
|
||||
|
||||
COPY default_prometheus_variables.sh start.sh /app/pkg/
|
||||
COPY env.sh.template start.sh /app/pkg/
|
||||
|
||||
CMD [ "/app/pkg/start.sh" ]
|
||||
|
|
10
start.sh
10
start.sh
|
@ -11,13 +11,15 @@ 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
|
||||
[[ -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/prometheus_variables.sh
|
||||
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}"
|
||||
|
|
Loading…
Reference in a new issue