rename to env.sh

This commit is contained in:
Girish Ramakrishnan 2023-05-05 09:08:49 +02:00
parent cf53245bff
commit 7fe4cf6fb2
3 changed files with 7 additions and 5 deletions

View file

@ -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 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" ] CMD [ "/app/pkg/start.sh" ]

View file

@ -11,13 +11,15 @@ fi
chown -R cloudron:cloudron /app/data chown -R cloudron:cloudron /app/data
if [[ ! -f /app/data/prometheus_variables.sh ]]; then [[ -f /app/data/prometheus_variables.sh ]] && mv /app/data/env.sh
echo "=> Copy default prometheus variable file since it does not exist"
cp /app/pkg/default_prometheus_variables.sh /app/data/prometheus_variables.sh if [[ ! -f /app/data/env.sh ]]; then
echo "=> Copy default env.sh"
cp /app/pkg/env.sh.template /app/data/env.sh
fi fi
echo "=> Source custom variables" echo "=> Source custom variables"
source /app/data/prometheus_variables.sh source /app/data/env.sh
echo "=> Starting Prometheus with retention time of $retention_time" 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}" 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}"