monitoring / Dockerfile
kadarakos's picture
Reset entrypoint to allow shell script execution
012845b
raw
history blame contribute delete
726 Bytes
FROM prom/prometheus:v2.45.0
USER root
# Create directory with correct permissions for the prometheus user (65534)
RUN mkdir -p /prometheus && chown -R 65534:65534 /prometheus
# Copy the template
COPY prometheus.yml.template /etc/prometheus/prometheus.yml.template
# Reset the entrypoint so we can run a shell script
ENTRYPOINT []
# Switch to the prometheus user
USER 65534
# Now we can safely run /bin/sh to process our template with sed
CMD ["/bin/sh", "-c", "\
sed \"s|\\${HF_TOKEN}|$HF_TOKEN|g\" /etc/prometheus/prometheus.yml.template > /etc/prometheus/prometheus.yml && \
/bin/prometheus --config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/prometheus \
--web.listen-address=:7860"]