File size: 844 Bytes
ec82763 03995dc ec82763 d8907be 27e1777 ec82763 d8907be cd0138c ec82763 d8907be 7313eba d8907be cd0138c 7313eba cd0138c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
FROM prom/prometheus:latest
USER root
WORKDIR /app
# Copy the config with the placeholder
COPY turing_cloud.yml /app/turing_cloud.yml
# Reset entrypoint
ENTRYPOINT ["/bin/sh", "-c"]
# Startup Command:
# 1. Export PORT (fallback to 7860)
# 2. Inject the PORT into the config
# 3. Inject the PASSWORD into the config (using | as delimiter to avoid issues with special chars)
# 4. Start Prometheus
CMD ["export RUN_PORT=${PORT:-7860} && \
echo 'System starting on PORT: '$RUN_PORT && \
sed -i \"s/localhost:7860/localhost:$RUN_PORT/g\" /app/turing_cloud.yml && \
sed -i \"s|GRAFANA_PASSWORD|$GRAFANA_PASSWORD|g\" /app/turing_cloud.yml && \
/bin/prometheus \
--config.file=/app/turing_cloud.yml \
--web.listen-address=0.0.0.0:$RUN_PORT \
--storage.tsdb.path=/prometheus \
--web.enable-lifecycle"] |